SA-MP Forums Archive
Stuff takes affect only after relog - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Stuff takes affect only after relog (/showthread.php?tid=420111)



Stuff takes affect only after relog - dusk - 03.03.2013

The problem is the lots of stuff start to work only after relog.For Example, when you get a job by this function:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid,3,590.677429,1230.618286,11.718750))
    {
        if(PlayerInfo[playerid][Job]==0)
        {
            SendClientMessage(playerid,0xFF8000FF,"Isidarbinote sunkvezimiu vairuotoju");
            PlayerInfo[playerid][Trucker]=1;
            PlayerInfo[playerid][Job]=1;
            SaveStats(playerid);
        }
    }
No errors no problems. But you can't do anything as a trucker,until you logout and login again...Anyone might know why?


Re: Stuff takes affect only after relog - lollie123 - 04.03.2013

pawn Код:
public OnPlayerDisconnect(playerid)
{
    PlayerInfo[playerid][Trucker]=0;
    PlayerInfo[playerid][Job]=0;
    return 1;
}



Re: Stuff takes affect only after relog - dusk - 04.03.2013

No,the i don't want to reset it when he exits. The problem is that it doesn't work UNTIL he exits and comes back again. I want it to work the second that he took the job