IsPlayerInVehicle: Difference between revisions

From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|IsPlayerInVehicle( [, player])}} {{FuncParameters}} {{FuncParam||__EDIT_ME__}} {{FuncParamOptional..."
 
28days (talk | contribs)
No edit summary
Line 1: Line 1:
{{Info|Function|Client|1.0}}
{{Info|Function|Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Check if player is in vehicle or not.}}


{{FuncSyntax|IsPlayerInVehicle( [, player])}}
{{FuncSyntax|IsPlayerInVehicle( [, player])}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam||__EDIT_ME__}}
{{FuncParamOptional|player|The player identifier}}
{{FuncParamOptional|player|__EDIT_ME__}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|__EDIT_ME__}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua">
AddEvent("OnKeyPress", function(key)
 
if not IsPlayerInVehicle() then
return
end
 
AddPlayerChat(player, "You are in a vehicle.")
end)
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
{{VehicleFunctions}}

Revision as of 16:40, 17 November 2019