/aduty Timer Help
#2

Hello there,

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;
}
Then;

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;
}
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;

pawn Код:
KillTimer(dutytimer[playerid]);
Reply


Messages In This Thread
/aduty Timer Help - by Mark_Samp - 06.01.2015, 23:33
Re: /aduty Timer Help - by Rufio - 06.01.2015, 23:46
Respuesta: /aduty Timer Help - by JuanStone - 07.01.2015, 01:22
Re: /aduty Timer Help - by Mark_Samp - 07.01.2015, 14:25

Forum Jump:


Users browsing this thread: 1 Guest(s)