Problem with anti-command. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with anti-command. (
/showthread.php?tid=272983)
Problem with anti-command. -
budelis - 30.07.2011
Hi all.I have problem with my anti-command.I get message "don't spamm" but,and always get message "Server:Unknow Command",and then when i write correct command is too.
Re: Problem with anti-command. -
CmZxC - 30.07.2011
could you post your 'anti-command' code ?
Re: Problem with anti-command. -
PowerPC603 - 30.07.2011
Did you forget a "return 1;" at the end of your command code?
Re: Problem with anti-command. -
budelis - 31.07.2011
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if( GetPVarInt( playerid,"AntiCommand" )> GetTickCount( ) )
{
SendClientMessage( playerid, 0xFF0000FF ,"Please don't spamm" );
return 0;
}
SetPVarInt( playerid,"AntiCommand",GetTickCount( )+2000 );
if ( !success )
{
SendClientMessage(playerid, COLOR_YELLOW,"This command no exist.All command /cmd");
}
return 1;
}
Re: Problem with anti-command. -
=WoR=Varth - 01.08.2011
You should put it inside your "OnPlayerCommandReceived"
https://sampforum.blast.hk/showthread.php?tid=91354
Re: Problem with anti-command. -
budelis - 02.08.2011
Thank you.