SA-MP Forums Archive
Strcmp with zcmd ?? is it possible - 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)
+--- Thread: Strcmp with zcmd ?? is it possible (/showthread.php?tid=474775)



Strcmp with zcmd ?? is it possible - DarkLored - 09.11.2013

Hello guys
is it possible to use zcmd with strcmp on a gamemode
cause when i tried doing that the strcmp command wont work it will show uknown command


Re: Strcmp with zcmd ?? is it possible - Voxel - 09.11.2013

No, its not possible to use them both.


Re: Strcmp with zcmd ?? is it possible - DarkLored - 09.11.2013

I once saw a thread that someone told how to do it but i forgot its name


Re: Strcmp with zcmd ?? is it possible - erminpr0 - 09.11.2013

Ofcourse you can, rename OnPlayerCommandText callback,
use this form:
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   if(success == 0) return SendClientMessage(playerid, -1, "[ERROR] That command doesn't exist!");

   if(!strcmp(cmdtext, "/test1", true))
   {
      SendClientMessage(playerid, 0xFFFFFFAA, "This is string-comparing command!");
      return 1;
   }

   return 1; //you must return 1 here
}

CMD:test2(playerid, params[])
{
   SendClientMessage(playerid, 0xFFFF00AA, "This is ZCMD command!");
   return 1;
}