/smoke system , i need help.
#1

Hello,

How can i make that you can do /smoke only every 2 minutes ?

Thanks
Reply
#2

with a timer ? how can i make that?
Reply
#3

pawn Код:
new SmokeWait[MAX_PLAYERS];
forward SmokeTimer(playerid);
Where your /smoke command is:
pawn Код:
if(SmokeWait[playerid] == 1) // If player has been smoking lately
{
    SendClientMessage(playerid, 0xFFFFFFFF, "You have to wait before smoking again");
    return 1;
}
SmokeWait[playerid] = 1; // Set this variable to 1 so player can't smoke next time
SetTimerEx("SmokeTimer", 120000, false, "i", playerid); // Timer to clear the variable after 2 minutes so player can smoke again
pawn Код:
public SmokeTimer(playerid)
{
    SmokeWait[playerid] = 0; // Now player can smoke again
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)