IsPlayerInAnyVehicle

From SA-MP Wiki

Jump to: navigation, search


Description:

Check if a player is inside any vehicle (as a driver or passenger).


Parameters:
(playerid)
playeridThe ID of the player to check.


Return Values:

  • 1: The player is in a vehicle.
  • 0: The player is not in a vehicle.


Example Usage:

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/invehicle", 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.

Personal tools
Navigation
Toolbox
In other languages