Delaying newbie chat
#2

pawn Код:
// Outside any callback
new bool: NewbieChatCooldown[MAX_PLAYERS];

// Top of your command or wherever, anywhere but before the actual code
if(NewbieChatCooldown[playerid]) return SendClientMessage(playerid, -1, "You can't talk in newbie chat yet!");

// After they have sent a message, do this:
NewbieChatCooldown[playerid] = true;
SetTimerEx("NewbieChatCDExpire", 30000, false, "i", playerid);

// Anywhere outside of a callback
forward NewbieChatCDExpire(playerid);
public NewbieChatCDExpire(playerid);
{
    NewbieChatCooldown[playerid] = false;

    return true;
}
EDIT: Make sure to NOT place the timer inside of the loop.
Reply


Messages In This Thread
Delaying newbie chat - by jackx3rx - 31.07.2014, 21:29
Re: Delaying newbie chat - by Dignity - 31.07.2014, 21:39
Re: Delaying newbie chat - by jackx3rx - 31.07.2014, 21:57
Re: Delaying newbie chat - by driftpower - 01.08.2014, 00:09

Forum Jump:


Users browsing this thread: 1 Guest(s)