IsPlayerInVehicle: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
{{FuncParamOptional|player|The player identifier}} | {{FuncParamOptional|player|The player identifier}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns '''true''' on success.}} | ||
== Example == | == Example == |
Latest revision as of 16:42, 17 November 2019
Description
Check if player is in vehicle or not.
Syntax
IsPlayerInVehicle( [, player])
Parameters
- player (optional)
The player identifier
Return Value
- Returns true on success.
Example
AddEvent("OnKeyPress", function(key)
if not IsPlayerInVehicle() then
return
end
AddPlayerChat(player, "You are in a vehicle.")
end)
See also
- CreateVehicle
- DestroyVehicle
- IsValidVehicle
- GetVehicleCount
- GetAllVehicles
- GetVehicleModel
- GetVehicleModelName
- SetVehicleRespawnParams
- IsVehicleStreamedIn
- GetStreamedVehiclesForPlayer
- GetStreamedVehicles
- SetVehicleLocation
- GetVehicleLocation
- SetVehicleRotation
- GetVehicleRotation
- SetVehicleHeading
- GetVehicleHeading
- SetVehicleHealth
- GetVehicleHealth
- SetVehicleLicensePlate
- GetVehicleVelocity
- GetVehicleDriver
- GetVehiclePassenger
- GetVehicleNumberOfSeats
- SetVehicleColor
- GetVehicleColor
- SetVehicleLinearVelocity
- SetVehicleAngularVelocity
- GetVehicleGear
- SetVehicleHoodRatio
- GetVehicleHoodRatio
- SetVehicleTrunkRatio
- GetVehicleTrunkRatio
- StartVehicleEngine
- StopVehicleEngine
- GetVehicleEngineState
- SetVehicleLightEnabled
- GetVehicleLightState
- SetVehicleDamage
- GetVehicleDamage
- AttachVehicleNitro