GetPlayerState

From SA-MP Wiki

Jump to: navigation, search

GetPlayerState


Get a player's current state


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


ReturnsThe current player's state as an integer.


public OnPlayerDeath(playerid, killerid, reason)
{
    new state = GetPlayerState(killerid);
    new weap= GetPlayerWeapon(killerid);
    if (state == PLAYER_STATE_PASSENGER || state == PLAYER_STATE_DRIVER)
    {
        if(weap == 32 || weap == 28 || weap == 29)
        {
            //It's a driveby, take some money
            GivePlayerMoney(killer, -10000);
        }
    }
    return 1;
}

Related Functions

The following functions might be useful as well, as they're 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