[HELP] PayDay with gl_realtime
#1

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)