OnClientVehicleNitroStateChange: Difference between revisions
Jump to navigation
Jump to search
m (→Example: Updated) |
|||
Line 16: | Line 16: | ||
<section name="Client" class="client" show="true"> | <section name="Client" class="client" show="true"> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function nitro_updateState(state) | ||
if | if state then | ||
outputChatBox(" | outputChatBox("Nitro #00FF00activated!", 255, 200, 0, true) | ||
elseif | elseif not state then | ||
outputChatBox("Nitro | outputChatBox("Nitro #FF0000deactivated!", 255, 200, 0, true) | ||
end | end | ||
end | end | ||
addEventHandler("onClientVehicleNitroStateChange", | addEventHandler("onClientVehicleNitroStateChange", root, nitro_updateState) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> |
Revision as of 22:16, 5 May 2013
This event gets triggered when nitro state is changing.
Parameters
bool state
- state: current state of nitro
Source
The source of this event is the player vehicle.
Example
This example is showing short chat message on nitro state changing.
Click to collapse [-]
Clientfunction nitro_updateState(state) if state then outputChatBox("Nitro #00FF00activated!", 255, 200, 0, true) elseif not state then outputChatBox("Nitro #FF0000deactivated!", 255, 200, 0, true) end end addEventHandler("onClientVehicleNitroStateChange", root, nitro_updateState)
See Also
Client vehicle events
- onClientTrailerAttach
- onClientTrailerDetach
- onClientVehicleCollision
- onClientVehicleDamage
- onClientVehicleEnter
- onClientVehicleExit
- onClientVehicleExplode
- onClientVehicleNitroStateChange
- onClientVehicleRespawn
- onClientVehicleStartEnter
- onClientVehicleStartExit
- onClientVehicleWeaponHit
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled