OnClientVehicleNitroStateChange: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Created page with "{{Client event}} __NOTOC__ This event gets triggered when nitro state is changing. ==Parameters== <syntaxhighlight lang="lua"> bool state </syntaxhighlight> *'''state:''' current state of nitro ==Source==...")
 
Line 19: Line 19:
         outputChatBox("You starts using nitro...", 150, 255, 150, true)
         outputChatBox("You starts using nitro...", 150, 255, 150, true)
     elseif (state == false) then
     elseif (state == false) then
         outputChatBox("Nitro fuel gots empty...", 255, 150, 150, true)
         outputChatBox("Nitro fuel runs empty...", 255, 150, 150, true)
     end
     end
end   
end   

Revision as of 21:59, 26 April 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 get short chat message on nitro state changing.

function nitroState(state)    
    if (state == true) then
        outputChatBox("You starts using nitro...", 150, 255, 150, true)
    elseif (state == false) then
        outputChatBox("Nitro fuel runs empty...", 255, 150, 150, true)
    end
end   
addEventHandler("onClientVehicleNitroStateChange", getRootElement(), nitroState)

See Also

Client vehicle events


Client event functions