OnPlayerStateChange
#1

Hey guys,
Im having problems with the callback OnPlayerStateChange. Im trying to check that the newstate == driver, and the oldstate == onfoot, and then show him a textdraw. Somehow it doesnt work, but in game it shows its changing.

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new string[39];
    format(string, sizeof(string), "You changed from state %d to state %d!", oldstate, newstate);
    SendClientMessage(playerid,0xFFFFFFFF,string);
    if( oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT )
    {
   
        TextDrawHideForPlayer(playerid, Speedo[playerid]);
    }
    if( oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER )
    {
        TextDrawShowForPlayer(playerid, Speedo[playerid]);
    }
    return 1;
}
It shows "You changed from state %d to state %d!" in game, with the %d with a number ofcourse.
Anyone knows what the problem is?
Reply


Messages In This Thread
OnPlayerStateChange - by Wesley221 - 31.08.2011, 18:14
Re : OnPlayerStateChange - by Naruto_Emilio - 31.08.2011, 18:17
Re: OnPlayerStateChange - by Wesley221 - 31.08.2011, 18:36
Re : OnPlayerStateChange - by Naruto_Emilio - 31.08.2011, 19:03
Re: OnPlayerStateChange - by Wesley221 - 31.08.2011, 19:13
Re : Re: OnPlayerStateChange - by Naruto_Emilio - 31.08.2011, 19:21
Re: OnPlayerStateChange - by Wesley221 - 31.08.2011, 20:06
Re : OnPlayerStateChange - by Naruto_Emilio - 31.08.2011, 21:29
Re: OnPlayerStateChange - by IceCube! - 31.08.2011, 21:37
Re: OnPlayerStateChange - by Wesley221 - 01.09.2011, 08:51

Forum Jump:


Users browsing this thread: 1 Guest(s)