SA-MP Forums Archive
[HELP] PayDay with gl_realtime - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] PayDay with gl_realtime (/showthread.php?tid=179052)



[HELP] PayDay with gl_realtime - Fredden1993 - 25.09.2010

As the title says, I'm tryin' to get a PayDay system to work with SA-MP's gl_realtime script, everytime it updates the time the PayDay should also update (After an hour).

My system works like this, if you are in a special gTeam it will give you a PayCheck after 3600000 milliseconds (One hour) but I think it makes the server laggin'.

pawn Код:
forward PayDay();
pawn Код:
PayDay();
SetTimer("PayDay", 3600000, 1);
pawn Код:
public PayDay()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new string[50];

            if(gTeam[i] == 2)
            {
                PlayerPlayMusic(i);
                PlayerInfo[i][pPayCheck] += 5000;
                format(string, sizeof(string), "~w~PayDay~n~~y~PayCheck~n~~g~$5000");
                GameTextForPlayer(i, string, 3000, 1);
                }
          }
    }
}
Alright, that is how it looks like now, how is it possible to make this update when the time updates in the gl_realtime?

Thanks