#1

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?
Reply
#2

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 "/".
Reply
#3

Okay, anyone that has used it?

Thanks for what you can help with Zez
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)