23.12.2012, 04:22
I edited my zcmd to fix these issues a long time ago
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (isnull(cmdtext))
{
// You can add other crash detect/warning code here.
return 0;
}
if (!CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
{
return 1;
}
new pos, funcname[MAX_FUNC_NAME];
while (cmdtextt[++pos] > ' ')
{
if(pos > MAX_FUNC_NAME) break;
funcname[pos-1] = tolower(cmdtextt[pos]);
}
format(funcname, sizeof(funcname), "cmd_%s", funcname);
while (cmdtextt[pos] == ' ') pos++;
if (!cmdtextt[pos])
{
return CallRemoteFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtextt, CallLocalFunction(funcname, "is", playerid, "\1"));
}
return CallRemoteFunction("OnPlayerCommandPerformed", "isi", playerid, cmdtextt, CallLocalFunction(funcname, "is", playerid, cmdtextt[pos]));
}