28.10.2010, 11:31
hy can som1 tell me how to make a cooldown i have airstrikes fs but i wanna to make that can be used every 3 minutes any help?
new usedcommand[MAX_PLAYERS];
usedcommand[playerid] =0;
usedcommand[playerid] =0;
usedcommand[playerid] =10; // 10 seconds?
if(usedcommand[playerid]) return SendClientMessage(playerid,COLOR,"Plz Wait");
SetTimer("loltimer",1000,1);
public loltimer()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(usedcommand[i] > 0)
{
usedcommand[i] --;
}
}
}
if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"wait 3 minutes");
SetPVarInt(playerid,"CMDABUSE",GetTickCount()+180000);