05.04.2013, 01:45
Hey, I've had this payday timer for a while and not got it working, so I am resorting to here.
That code runs on a timer for each minute, I know that's a bad idea, can you see any reasons why it doesn't trigger on each hour?
Код:
forward Payday();
public Payday() {
new hour, minute, second, String[200];
gettime(hour, minute, second);
if(minute == 0 && second == 0) {
foreach(new i : Player) {
if(IsPlayerConnected(i)) {
PlayerInfo[i][pBank] += 5*PlayerInfo[i][pLevel];
SendClientMessage(i, COLOR_WHITE, "{006AFF}_____|{0048AD}PAYDAY{006AFF}|_____");
format(String, sizeof String, "{006AFF}New Balance: {ADADAD}$%d", PlayerInfo[i][pBank]);
SendClientMessage(i, COLOR_WHITE, String);
format(String, sizeof String, "SERVER: {FFFFFF}New server time, %02d:%02d.", hour, minute);
SendClientMessage(i, COLOR_TANNED, String);
}
}
FixHour(hour);
SetWorldTime(hour);
}
return 1;
}

