OnPlayerStateChange
From SA-MP Wiki
OnPlayerStateChange
This callback is called when a player changes state.
(playerid, newstate, oldstate)
| playerid | The ID of the player that changed state. |
| newstate | The state the player is now. |
| oldstate | The previous state of the player. |
This function does not return a specific value.
public OnPlayerStateChange(playerid,newstate,oldstate) { new string[48]; format(string, sizeof(string), "You changed from state %d to state %d!",oldstate,newstate); SendClientMessage(playerid,0xFFFFFFFF,string); return 1; }
Related Callbacks
The following callbacks might be useful as well, as they're related to this callback in one way or another.
- OnPlayerInteriorChange: Called when a player changes interior.
Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- GetPlayerState: Get a player's current state.
- SetPlayerSpecialAction: Set a player's special action.
- GetPlayerSpecialAction: Get a player's current special action.
