OnPlayerToggleVehicleNitro

From Onset Developer Wiki
Revision as of 09:03, 24 May 2020 by BlueMountains (talk | contribs) (Created page with "{{Info|Event|Client|1.2.0}} {{FuncDescription|Called when a (local) player presses the key to turn nitro on/off. You can return '''false''' to prevent turning it on. Requires...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
OnPlayerToggleVehicleNitro

Type: Event
Context: Client
Introduced: v1.2.0

Description

Called when a (local) player presses the key to turn nitro on/off. You can return false to prevent turning it on. Requires AttachVehicleNitro to be enabled on the vehicle.

Syntax

OnPlayerToggleVehicleNitro(vehicle, toggle)
  • vehicle
    The vehicle identifier.
  • toggle
    true if the player will turn on nitro, false otherwise.

Example

AddEvent("OnPlayerToggleVehicleNitro", function(vehicle, toggle)
    if toggle == true then
        return false -- do not allow the player to turn on the nitro
    end
end)

See also