How to make text wait before it appears
#3

If you don't want players to spam, then an anti spam would be the solution:

GetTickCount() returns the amount of milliseconds since server started, you can do the following

pawn Код:
if(KEYS == KEY_NO)
{
    if(GetPVarInt(playerid,"lastpress") > GetTickCount())
             return 1;

    // insert your code

    SetPVarInt(playerid,"lastpress", GetTickCount()+500); //500 MS before the function can be executed again.

}
You assign a variable the current time+500 MS. When the key is pressed again, it will check if the current time is less than that variable that you previously set, and this means that 500 MS haven't passed.
By using timers, without this kind of checks what you're going to achieve is that the timer gets sent multiple times.

However if you just want to delay the action (players would still be able to spam it), refeer to the post above.
Reply


Messages In This Thread
How to make text wait before it appears - by LazyGamer99 - 30.01.2014, 12:36
Re: How to make text wait before it appears - by Twizted - 30.01.2014, 12:38
Re: How to make text wait before it appears - by CuervO - 30.01.2014, 12:46

Forum Jump:


Users browsing this thread: 2 Guest(s)