06.01.2015, 23:46
Hello there,
The functions you should use are;
SetTimerEx, give an ID to the timer such as this;
Then;
This is basically very basic and simple system from me, you can make it advanced for your needs.
Edit: When the admin goes off duty just simply type this below that code;
The functions you should use are;
SetTimerEx, give an ID to the timer such as this;
pawn Код:
new dutytimer[MAX_PLAYERS];
// Your aduty command here
{
// bla bla bla
new dutytime = 60*1000*60;
dutytimer[playerid] = SetTimerEx("DutyToken",dutytime,true,"i",playerid); // Here, we set a timer which loops unless killed, with function being called as "DutyToken", dutytime calculates the time.
return 1;
}
pawn Код:
forward DutyToken(playerid);
public DutyToken(playerid)
{
SendClientMessage(playerid,-1,"{00FF00}[INFO]: {FFFFFF}You have been on aduty for 1 hour and have obtained a token.");
pInfo[playerid][DutyToken]++;// Change it to your variable.
return 1;
}
Edit: When the admin goes off duty just simply type this below that code;
pawn Код:
KillTimer(dutytimer[playerid]);