SA-MP Forums Archive
[HELP] UpdateTime - 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] UpdateTime (/showthread.php?tid=181985)



[HELP] UpdateTime - Fredden1993 - 08.10.2010

I've made some edits to the gl_realtime script by the samp team but I'm not sure if it works. It should update pLevel, pPayCheck, pTime and the clock of course and I want this to update every hour.

pawn Код:
//On top of the script
forward UpdateTime();

//Under OnGameModeInit
UpdateTime();
SetTimer("UpdateTime", 3600000, 1);

//Somewhere
public UpdateTime()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        gettime(hour, minute);

        SetWorldTime(hour);
        PayDay();
        PlayerInfo[i][pLevel] += 1;
        PlayerInfo[i][pTime] += 1;
        new x=0;
        while(x!=MAX_PLAYERS) {
            if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) {
                SetPlayerTime(x,hour,minute);
             }
             x++;
        }
    }
}
If you find any problems in it, please help me to repair it.

Thanks

NOTE: I want the pLevel and pTime to increase by '1' every hour.


Re: [HELP] UpdateTime - Sascha - 08.10.2010

You could better write PlayerInfo[i][pLevel]++;
same for the other thing... Im not sure if yours will work