OnPlayerStateChange
From SA-MP Wiki
OnPlayerStateChange
This callback is called when state of player changes.
(playerid, newstate, oldstate)
| playerid | ID of the player whos state changed. |
| newstate | The state the player changed to |
| oldstate | The state the player changed from |
This function does not return a specific value, it's best to simply ignore it.
public OnPlayerStateChange(playerid,newstate,oldstate) { new string[128]; format(string, sizeof(string), "You changed from state %d to state %d!",oldstate,newstate); SendClientMessage(playerid,COLOR_ORANGE,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 players interior changes
Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- GetPlayerState: Return the players current state
