26.01.2011, 20:31
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);
}
}