SA-MP Forums Archive
Converting strcmp to 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)
+--- Thread: Converting strcmp to ZCMD? (/showthread.php?tid=409886)



Converting strcmp to ZCMD? - geohareas - 23.01.2013

Well,guys i had to leave scripting for sometime,cause of my studies.Now i am back,and I see that many goodies have been realised,such ZCMD.Unfortunently,i dont have the scripting knowledge that i had in the past..and I got an 72.000 gamemode,scripted by me in strcmp.Just because its awuful,and it takes an hour compiling it,I decided scripting the gamemode again but with ZCMD instead of strcmp..Its gonna take hours but,can you please explain me how?


Re: Converting strcmp to ZCMD? - DaRk_RaiN - 23.01.2013

Its quite easy actually, here's a little example
pawn Код:
//with ZCMD
CMD:help(playerid, params[])
{
    SendClientMessage(playerid,COLOR_ORANGERED,"Hello");
    return 1;
}
//with strcmp
    if (strcmp("/help", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid,COLOR_ORANGERED,"Hello");   
        return 1;
    }
Now if the command you used have used params(E.G:/ban ID REASON), usualy in strcmp you use strtok, in ZCMD use sscanf, its a lot faster/easier too.


Re: Converting strcmp to ZCMD? - DiGiTaL_AnGeL - 23.01.2013

I suggest you to use YCMD, not ZCMD


AW: Re: Converting strcmp to ZCMD? - Blackazur - 23.01.2013

Quote:
Originally Posted by DiGiTaL_AnGeL
Посмотреть сообщение
I suggest you to use YCMD, not ZCMD
I find ZCMD is the best.