Anti spam for PM [help][reps]
#4

Quote:
Originally Posted by MahdiGames
Посмотреть сообщение
Код:
public OnPlayerCommandText(playerid, cmdtext[])

{
if(GetPVarInt(playerid, "lastcommand") > GetTickCount())
{
    SendClientMessage(playerid, 0x00FFFFFF, "Slow it down on the commands!");
    SetPVarInt(playerid, "lastcommand", GetTickCount()+500);
    return 1;
}

SetPVarInt(playerid, "lastcommand", GetTickCount()+500);
}
Like that? Thanks!
If you put it at OnPlayerCommandText it must be on the top and the check must return 0;

What that code does is it stores in a variable when the player is able to send a command again (current time + 500 MS). If the player sends a command before that time, it will add another 500 MS to the time and will not allow him to send the command.
Reply


Messages In This Thread
Anti spam for PM [help][reps] - by MahdiGames - 01.02.2014, 05:52
Re: Anti spam for PM [help][reps] - by CuervO - 01.02.2014, 05:57
Re: Anti spam for PM [help][reps] - by MahdiGames - 01.02.2014, 06:01
Re: Anti spam for PM [help][reps] - by CuervO - 01.02.2014, 06:12
Re: Anti spam for PM [help][reps] - by MahdiGames - 01.02.2014, 06:22
Re: Anti spam for PM [help][reps] - by CuervO - 01.02.2014, 06:29

Forum Jump:


Users browsing this thread: 1 Guest(s)