IsPlayerInVehicle
From SA-MP Wiki
(Difference between revisions)
Revision as of 16:38, 21 June 2013 Smithy (Talk | contribs) ← Previous diff |
Revision as of 13:31, 31 January 2014 Connor Mead (Talk | contribs) Next diff → |
||
Line 33: | Line 33: | ||
[[Category:Scripting Functions]] | [[Category:Scripting Functions]] | ||
+ | [[fr:IsPlayerInVehicle]] |
Revision as of 13:31, 31 January 2014
Description:
Checks if a player is in a specific vehicle.
(playerid, vehicleid)
playerid | ID of the player. |
vehicleid | ID of the vehicle. |
Return Values:
- true - Player IS in the vehicle.
- false - Player is NOT in the vehicle.
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/checkmycar", true) == 0) { if(IsPlayerInVehicle(playerid, 32)) { SendClientMessage(playerid,0xFFFFFFFFF,"You're in vehicle 32!"); } return 1; } return 0; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- IsPlayerInAnyVehicle: Check if a player is in any vehicle.
- GetPlayerVehicleSeat: Check what seat a player is in.