OnPlayerStateChange

From SA-MP Wiki

Jump to: navigation, search

OnPlayerStateChange


This callback is called when a player changes state.


Parameters:
(playerid, newstate, oldstate)
playeridThe ID of the player that changed state.
newstateThe state the player is now.
oldstateThe 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.


Related Functions

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

Personal tools