I need a little help
#3

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
That won't work like this.

Try:

On TOP:
pawn Код:
new LastCmd[MAX_PLAYERS];
OnPlayerConnect:
pawn Код:
LastCmd[playerid] = 0;
OnPlayerCommandText:
pawn Код:
if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid))
{
    SendClientMessage(playerid, 0xFF0000FF, "* {6EF83C}You can only use commands once {F81414}every two seconds.");
    return 1;
}
LastCmd[playerid] = gettime();
At Bottom:

pawn Код:
stock IsPlayerFlooding(playerid)
{
    if(LastCmd[playerid] + 2 > gettime()) return 1; //Flooding: Yes
    else return 0; //Flooding: No
}
Cheers.
gettime?
Don't you mean GetTickCount?
Reply


Messages In This Thread
I need a little help - by xSkullx - 24.07.2012, 16:56
Re: I need a little help - by Jeffry - 24.07.2012, 17:57
Re: I need a little help - by FireCat - 24.07.2012, 17:59
Re: I need a little help - by Jeffry - 24.07.2012, 18:07
Re: I need a little help - by xSkullx - 24.07.2012, 18:22

Forum Jump:


Users browsing this thread: 2 Guest(s)