Define Params manually
#1

I'm trying to define Params manually. I'm updating a script from strtok to sscanf. But I do not wish to change over 100 commands to DCMD. So I'd like to define Params manually. How could I do it?
I thought of something like "new params = cmdtext[];", I hope you get what I mean. But I don't think that will work.

I hope you can help me.
Reply
#2

This got owned by Calg00ne's post.
Reply
#3

DCMD aren't like publics - once again, you have no idea about what you're talking about "Mean."

Furthermore, for ZCMD, ZCMD has a callback that is called prior to the command being executed, you could parse the data in THAT callback.

For DCMD, you can still use the cmdtext within the OnPlayerCommandText callback, or you can alternatively create another string and use strcat to copy the string data - you're better off finding & replacing the strings though (i.e: Replace "params" to "cmdtext" - if that's what you want).
Reply
#4

Thanks, Calgon.
Reply
#5

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
DCMD aren't like publics - once again, you have no idea about what you're talking about "Mean."

Furthermore, for ZCMD, ZCMD has a callback that is called prior to the command being executed, you could parse the data in THAT callback.

For DCMD, you can still use the cmdtext within the OnPlayerCommandText callback, or you can alternatively create another string and use strcat to copy the string data - you're better off finding & replacing the strings though (i.e: Replace "params" to "cmdtext" - if that's what you want).
What I found in ZCMD include:
pawn Код:
#define COMMAND:%1(%2)          \
            forward cmd_%1(%2); \
            public cmd_%1(%2)
Reply
#6

Quote:
Originally Posted by Mean
Посмотреть сообщение
What I found in ZCMD include:
pawn Код:
#define COMMAND:%1(%2)          \
            forward cmd_%1(%2); \
            public cmd_%1(%2)
Yes, and ZCMD is NOT DCMD - they do not function in the same way.
Reply
#7

100 commands won't take you longer than 8 hours. I had 70 and It only took me 5. Just work and do it, it's worth in the end.
Reply
#8

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
Yes, and ZCMD is NOT DCMD - they do not function in the same way.
Oh yeah.
I failed, I meant ZCMD is like forward & public, not DCMD.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)