[HELP] UpdateTime
#1

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.
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)