ZCMD And Strcmp - 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: ZCMD And Strcmp (
/showthread.php?tid=358592)
ZCMD And Strcmp -
kepa333 - 11.07.2012
Is ther any possability to Use Strcmp And ZCMD ,
becouse my Scipt is 100 procent Strcmp but ive found a new vehicle system wichs i wish to Have on my script but its ZCMD What happends if i Download ZCMD Inlcude and put it in my old strcmp commands will still work/? Reply pls.
example of strcmp
if(!strcmp(cmdtext, "/adminduty", true) || !strcmp(cmdtext, "/aduty", true)) // Original by LordMan, Modded 99%
Re: ZCMD And Strcmp -
Larceny - 11.07.2012
pawn Код:
//Change:
public OnPlayerCommandText(playerid, cmdtext[])
{
//...
}
//To:
forward OnPlayerCommandTextEx(playerid, cmdtext[]);
public OnPlayerCommandTextEx(playerid, cmdtext[])
{
//...
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success)//ZCMD's Callback
{
if(!success) success = OnPlayerCommandTextEx(playerid,cmdtext);// << Add it.
return success;
}
It is recommended that you update your strcmp to zcmd/ycmd.
Re: ZCMD And Strcmp -
kepa333 - 11.07.2012
My gamemode has 100 k lines aint going to do that lol that will take years.
So with this i can have both?
Re: ZCMD And Strcmp -
Dan. - 11.07.2012
https://sampforum.blast.hk/showthread.php?tid=276063
Re: ZCMD And Strcmp -
Larceny - 11.07.2012
Quote:
Originally Posted by kepa333
So with this i can have both?
|
Theoretically yes, try it.
Re: ZCMD And Strcmp -
DarrenReeder - 11.07.2012
yes you could use both. But It's recommend you update the most used commands to zcmd and preferably sscanf as well. So, if you have a RP script with a housing system, then try to use mostly zcmd for the commands in the housing system.
The only reason i say this, is because zcmd/ycmd are A LOT faster executed than strcmp and its just cleaner to work with.
Re: ZCMD And Strcmp -
kepa333 - 12.07.2012
Well guys Ive started Working with Strcmp on my firsht script project and i do it for a long time , Ive no idea how i convert to ZCMD thanks anyway