GetPlayerState

From SA-MP Wiki

Jump to: navigation, search


Description:

Get a player's current state.


Parameters:
(playerid)
playeridThe ID of the player to get the current state of.


Return Values:

The player's current state as an integer.


Example Usage:

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

The following functions may be useful, as they are related to this function in one way or another.


Related Callbacks

The following callbacks might be useful, as they're related to this function in one way or another.

Personal tools
Navigation
Toolbox
In other languages