Dcmd - 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: Dcmd (
/showthread.php?tid=161038)
Dcmd -
ScottCFR - 18.07.2010
I'm looking towards converting my script to DCMD. It's all good but I'm having trouble understanding
Код:
dcmd(heal, 4, cmdtext);
(Got it from wiki). I understand heal (command) and cmdtext but the 4 what exactly is that?
Re: Dcmd -
Zezombia - 18.07.2010
The 4 is to count how many characters are in the command, aka "heal".
"ban", for example, would only have 3.
I havn't used dcmd before, but I assume it serves the same function as it would on a traditional cmdtext command:
pawn Код:
if(strcmp(cmdtext, "/heal", 5) == 0)
if(strcmp(cmdtext, "/ban", 4) == 0)
1 more because of including the "/".
Re: Dcmd -
ScottCFR - 18.07.2010
Okay, anyone that has used it?
Thanks for what you can help with Zez
Re: Dcmd -
Mystique - 18.07.2010
Well, I have been using dcmd for a while and the benefit with it is that you can use the params. I would also suggest you to try sscanf if you want to make params easily and fast. It is compatible with dcmd.