[Include] cMd (command processor)
#5

change
if(!strlen(cMdtMp[1]))
to
if(isnull(cMdtMp[1]))

or even
if(sscanf(cmdtext[1], "sS(' ')", cMdtMp[0], cMdtMp[1]))
THE CORRECT CODE WOULD BE:

pawn Код:
#define do_cMd; \
new cMdtMp[2][128], cMd;  \
sscanf(cmdtext[1], "sS(' ')", cMdtMp[0], cMdtMp[1]) format(cmdtext, 32, "cMd_%s", cMdtMp[0]);\
if(funcidx(cmdtext) != -1) { if(!cMd) { cMd = 1; CallLocalFunction(cmdtext, "ds", playerid, cMdtMp[1]); } }
Not sure how default string is defined in sscanf.
However, if you don't use optional string in sscanf, then cMdtMp[0] will also be empty if there were no params.
Cheers.

Edit: You should make it NON case sensitive.
Reply


Messages In This Thread
cMd v0.1a (command processor) - by Meta - 27.11.2011, 03:53
Re: cMd (command processor) - by Kar - 27.11.2011, 04:39
AW: Re: cMd (command processor) - by Meta - 27.11.2011, 05:35
Respuesta: cMd (command processor) - by [Nikk] - 27.11.2011, 05:50
Re: cMd (command processor) - by wups - 27.11.2011, 09:35
Re: cMd (command processor) - by Danny - 27.11.2011, 09:44
Re: cMd (command processor) - by Max_Coldheart - 27.11.2011, 09:46
Re: cMd (command processor) - by Nenad - 27.11.2011, 10:00
Re: cMd (command processor) - by TheArcher - 27.11.2011, 10:08
Re: cMd (command processor) - by [S]trong - 27.11.2011, 10:18

Forum Jump:


Users browsing this thread: 1 Guest(s)