[HELP] CoolDown Timer
#2

pawn Код:
//At the top somewhere, outside a function:
new CoolDown[MAX_PLAYERS];
new CoolTimer;
 //Your Command:
if(strcmp(cmd, "/neon", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 1471.4198,-1497.0950,13.5469))
        {
           if(CoolDown[playerid] == 0)
           {
                  ShowPlayerDialog(playerid, 8899, DIALOG_STYLE_LIST, "Pick Neon Color", "Blue\nRed\nGreen\nWhite\nPink\nYellow\nRemove All Neon", "Select", "Cancel");
                   PlayerPlaySound(playerid, 1133, 0.0, 0.0, 7.0);
                  CoolTimer = SetTimerEx("CoolDown", 40*1000, true, "i", playerid);
            }
        else return SendClientMessage(playerid, 0xFF0000AA, "You cannot use this again for 40 seconds!");
        }
        return 1;
    }

//at the bottom:

public CoolDown(playerid)
{
     if(CoolDown[playerid] == 0) return CoolDown[playerid] = 1;
     else
     {
          CoolDown[playerid] = 0;
          KillTimer(CoolTimer);
     }
}
Not tested, but its the basic concept
Reply


Messages In This Thread
[HELP] CoolDown Timer - by Chalwa - 26.01.2011, 20:15
Re: [HELP] CoolDown Timer - by randomkid88 - 26.01.2011, 20:31
Re: [HELP] CoolDown Timer - by Chalwa - 26.01.2011, 22:10
Re: [HELP] CoolDown Timer - by randomkid88 - 26.01.2011, 22:17
Re: [HELP] CoolDown Timer - by Chalwa - 26.01.2011, 22:30
Re: [HELP] CoolDown Timer - by randomkid88 - 26.01.2011, 23:11
Re: [HELP] CoolDown Timer - by Chalwa - 26.01.2011, 23:21
Re: [HELP] CoolDown Timer - by Chalwa - 27.01.2011, 00:42
Re: [HELP] CoolDown Timer - by randomkid88 - 27.01.2011, 00:45

Forum Jump:


Users browsing this thread: 2 Guest(s)