OnPlayerEnterVehicle: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Event|Server|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|OnPlayerEnterVehicle}} {{FuncParameters}} == Example == __EDIT_ME__ {{RelatedFunctions}} {{ServerEve..." |
m Wrong tag. |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Event|Server|1.0}} | {{Info|Event|Server & Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|This event is called when a player enters a vehicle.}} | ||
{{FuncSyntax|OnPlayerEnterVehicle}} | {{FuncSyntax|OnPlayerEnterVehicle(player, vehicle, seat)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|player|The player is entering a vehicle.}} | |||
{{FuncParam|vehicle|The vehicle in which he is getting in.}} | |||
{{FuncParam|seat|The seat of the vehicle.}} | |||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
AddEvent("OnPlayerEnterVehicle", function(playerid, vehicle, seat) | |||
if seat ~= 0 then | |||
AddPlayerChat(playerid, "You have entered the vehicle "..vehicle.." as a passenger.") | |||
end | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{ | {{VehicleEvents}} |
Latest revision as of 08:10, 16 January 2020
Description
This event is called when a player enters a vehicle.
Syntax
OnPlayerEnterVehicle(player, vehicle, seat)
Parameters
- player
The player is entering a vehicle. - vehicle
The vehicle in which he is getting in. - seat
The seat of the vehicle.
Example
AddEvent("OnPlayerEnterVehicle", function(playerid, vehicle, seat)
if seat ~= 0 then
AddPlayerChat(playerid, "You have entered the vehicle "..vehicle.." as a passenger.")
end
end)