GetPlayerState

Description

Get a player's current state.

NameDescription
playeridThe ID of the player to get the current state of.

Returns

The player's current state as an integer (see: Player States).

Examples

public OnPlayerDeath(playerid, killerid, reason)
{
new playerState = GetPlayerState(killerid); // Get the killer's state
if (playerState == PLAYER_STATE_DRIVER) // If the killer was in a vehicle
{
//It's a driver drive-by, take some money
GivePlayerMoney(killerid, -10000);
}
return 1;
}

Related Functions