Posts: 119
Threads: 32
Joined: Mar 2010
Reputation:
0
Well, I am trying to convert my gamemode commands to ZCMD, (its a gf edit) but when I make a command with zcmd, and when I made a cmd like "/id" (COMMAND:ID etc etc), I cannot use other commands in strcmp
all it says "SERVER UNKNOWN COMMAND"
help please
Posts: 1,843
Threads: 8
Joined: Nov 2008
Reputation:
0
ZCMD, and strcmp commands cannot be used together AFAIK. All commands have to be ZCMD or strcmp, you can't mix the two.
Posts: 944
Threads: 77
Joined: Dec 2010
Reputation:
0
dcmd can be, because zcmd disables the OnPlayerCommandText callback.
Posts: 1,047
Threads: 23
Joined: Jun 2009
Quote:
Originally Posted by Markx
dcmd can be, because zcmd disables the OnPlayerCommandText callback.
|
oh really?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
//strcmp
if(!strcmp(cmdtext,"/MyCommand",true))
{
SendClientMessage(playerid,0,"It works and this text is black!");
return 1;
}
//zcmd
if (zcmd_g_HasOPCS && !CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
{
return 1;
}
new
pos,
funcname[MAX_FUNC_NAME];
while (cmdtext[++pos] > ' ')
{
funcname[pos-1] = tolower(cmdtext[pos]);
}
format(funcname, sizeof(funcname), "cmd_%s", funcname);
while (cmdtext[pos] == ' ') pos++;
if (!cmdtext[pos])
{
if (zcmd_g_HasOPCE)
{
return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, "\1"));
}
return CallLocalFunction(funcname, "is", playerid, "\1");
}
if (zcmd_g_HasOPCE)
{
return CallLocalFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtext, CallLocalFunction(funcname, "is", playerid, cmdtext[pos]));
}
return CallLocalFunction(funcname, "is", playerid, cmdtext[pos]);
}
just put the strcmp command(s) BEFORE zcmd.
Anyway I do not recomend using 2 command processors at one time.