warning Not Translated
This page has not been translated into the language that your browser requested yet. The English content is being shown as a fallback.
If you want to contribute a translation for this page then please click here.
GetPlayerState
Description
Get a player's current state.
Name | Description |
---|---|
playerid | The 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, WEAPON:reason)
{
new PLAYER_STATE:state = GetPlayerState(killerid); // Get the killer's state
if (state == 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
- GetPlayerSpecialAction: Get a player's current special action.
- SetPlayerSpecialAction: Set a player's special action.
Related Callbacks
- OnPlayerStateChange: Called when a player changes state.