09.10.2018, 19:58
Is there a possibility to anticommandspam while using ocmd without checking commandspam before
every single command?
every single command?
if(Player[playerid][IsLoggedIn] == false) return ShowPlayerFooter(playerid, "You need to be ~r~logged ~w~to use commands.", 5000);
Use a mixture of this tutorial by [HLF]Southclaw & OnPlayerCommandRecieved
|
SetPVarInt(playerid,"CmdTime",GetTickCount()+10000);//10000 stands for 10 seconds
if(GetPVarInt(playerid,"CmdTime")>GetTickCount()) return SendClientMessage(playerid,-1,"* Please wait before using this command again.");
Why use something like that if it's just done with a single line?
|
...Or if you wish to block just some commands:
Put: pawn Код:
And: pawn Код:
Obviosuly pvars are just an idea. You can use tick count instead if you wish. |
lastcommand[playerid] = gettime()+10000;