27.08.2009, 11:49
Hey.
I'm thinking about moving from dcmd to zcmd, but I have one problem.
My current OnPlayerCommandText looks like this:
I want to keep that checks, so I use method from note #1 about manually calling ZCMD_ProcessCommand. I did that and made test command /lol. When I came IG and used /lol it did what it was supposed to do, but on the end it returned 0 (SERVER: Unknown command).
I deleted manual calling ZCMD_ProcessCommand and left my default OnPlayerCommandText and everything worked fine (checks from OnPlayerCommandText were called and it didn't returned 0 on the end). I don't know if this is the best solution, so I would like to use that with manual calling more likely.
So what am I doing wrong here?
I'm thinking about moving from dcmd to zcmd, but I have one problem.
My current OnPlayerCommandText looks like this:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(IsPlayerConnected(playerid) && gPlayerLogged[playerid] == 1)
{
...
dcmd(bla,3,cmdtext);
...
}
else
{
SendClientMessage(playerid,COLOR_RED,"[INFO:] Your not logged in, therefore you can not use any commands.");
SendClientMessage(playerid,COLOR_RED,"[INFO:] Type your password to register/login.");
return 1;
}
return 0;
}
pawn Code:
zcmd(lol,playerid,params[])
{
#pragma unused params
SendClientMessage(playerid,COLOR_WHITE,"It works");
return 1;
}
So what am I doing wrong here?