note Help Needed
This wiki is the result of an ongoing community effort — thank you all for helping!
If you want to provide changes to this page then please click here.
IsPlayerInAnyVehicle
Description
Check if a player is inside any vehicle (as a driver or passenger).
Name | Description |
---|---|
playerid | The ID of the player to check. |
Returns
true - The player is in a vehicle.
false - The player is not in a vehicle.
Examples
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/invehicle", true) == 0)
{
if (IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, 0x00FF00FF, "You're in a vehicle.");
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "You're not in any vehicle.");
}
return 1;
}
return 0;
}
Related Functions
- IsPlayerInVehicle: Check if a player is in a certain vehicle.
- GetPlayerVehicleSeat: Check what seat a player is in.