IsPlayerInAnyVehicle
From SA-MP Wiki
Check if a player is inside any vehicle.
(playerid)
| playerid | The ID of the player to check whether they are in any vehicle |
| Returns | 0 if the player is not in a vehicle, 1 if they are |
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/checkmycar", true) == 0) { if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,0x00FF00AA,"You're in a vehicle."); return 1; } return 0; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- IsPlayerInVehicle: Check if a player is in a certain vehicle.
- GetPlayerVehicleSeat: Check what seat a player is in.
