ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setPedHornState

Function

setPedHornState

ServerPedsTrilogy Hub only

Turns the NPC driver's horn on or off. Players nearby hear it. Works while driving with setPedDriveRoute or setPedDriveTo.

Syntax

bool setPedHornState(ped ped, bool state)

Arguments

pedped
The NPC.
statebool
true honks, false stops.

Returns

true on success; false if the NPC is not driving.

Example

addEventHandler("onPedDriveBlocked", driver, function()
    setPedHornState(source, true)
    setTimer(setPedHornState, 1500, 1, source, false)
end)

See also