08.10.2010, 14:23
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.
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.
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++;
}
}
}
Thanks
NOTE: I want the pLevel and pTime to increase by '1' every hour.