OnPlayerToggleVehicleHorn

From Onset Developer Wiki
Revision as of 12:23, 9 January 2021 by BlueMountains (talk | contribs) (Created page with "{{Info|Event|Client|1.2.2}} {{FuncDescription|Called when a (local) player presses the key to turn the horn on/off. You can return '''false''' to prevent turning it on.}} {{...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
OnPlayerToggleVehicleHorn

Type: Event
Context: Client
Introduced: v1.2.2

Description

Called when a (local) player presses the key to turn the horn on/off. You can return false to prevent turning it on.

Syntax

OnPlayerToggleVehicleHorn(vehicle, toggle)
  • vehicle
    The vehicle identifier.
  • toggle
    true if the player turns on the horn, false otherwise.

Example

AddEvent("OnPlayerToggleVehicleHorn", function(vehicle, toggle)
    if toggle == true then
        return false -- do not allow the player to use the horn
    end
end)

See also