OnPlayerStateChange

From SA-MP Wiki

Jump to: navigation, search

OnPlayerStateChange


This callback is called when state of player changes.


Parameters:
(playerid, newstate, oldstate)
playeridID of the player whos state changed.
newstateThe state the player changed to
oldstateThe 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.


Related Functions

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

Personal tools