07.04.2010, 15:47
you could create one simple timer just like that...
pawn Код:
new jobTime[MAX_PLAYERS];
pawn Код:
public OnGameModeInit()
{
SetTimer("UpdateJob", 60000, 1);
return 1;
}
pawn Код:
forward UpdateJob();
public UpdateJob()
{
for(new i; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
if(jobTime[i] > 0) jobTime[i]--;
}
}
pawn Код:
//When a player finishes his job set jobTime to whatever you want
jobTime[playerid] = 30; // Next job available in 30 minutes
new str[128];
if(jobTime[playerid] > 0)
{
format(str, sizeof(str), "Please come back in %d minutes...", jobTime[playerid]);
SendClientMessage(playerid, WHITE);
}