SA-MP Forums Archive
Zcmd - 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: Zcmd (/showthread.php?tid=244474)



Zcmd - Rock_Ro - 27.03.2011

Hey , i have a small problem with my commands in my gamemode.
When i type a command it says Unknown command but the command it works.
This is how my OnPlayerCommandPerformed callback look like
Код:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
   if( success == 0 ) return SendClientMessage( playerid, 0xAAAAAA, "Unknown Command. Use /cmds" );
   return 1;
}



Re: Zcmd - maramizo - 27.03.2011

pawn Код:
if(!success)
?


Re: Zcmd - Calgon - 27.03.2011

Return 1 in your commands that exist.

Your code there is fine, success returns 0 if the command doesn't exist or the command didn't return anything.


Re: Zcmd - Rock_Ro - 27.03.2011

Calgone , thanks you're right it works now , i forget to return 1 at some commands .