Problem with anti-command.
#1

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.
Reply
#2

could you post your 'anti-command' code ?
Reply
#3

Did you forget a "return 1;" at the end of your command code?
Reply
#4

Код:
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;
}
Reply
#5

You should put it inside your "OnPlayerCommandReceived"
https://sampforum.blast.hk/showthread.php?tid=91354
Reply
#6

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)