SA-MP Forums Archive
ZCMD Problems - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ZCMD Problems (/showthread.php?tid=170048)



ZCMD Problems - KingstoN* - 21.08.2010

I decided to use in my GameMode ZCMD commands, but I can not use the other old commands, only ZCMD other commands generate the message. "Server: Unknow Command"

What's wrong?


Re: ZCMD Problems - Scenario - 21.08.2010

ZCMD isn't natively compatible with "OnPlayerCommandText". I think there's a way around it, but I'm not sure how to do it myself. Either switch your commands to ZCMD or use "OnPlayerCommandText", sorry bro.


Re: ZCMD Problems - KingstoN* - 21.08.2010

Okay, i'll change my commands to dcmd cuz it works

Thank you man.


Re: ZCMD Problems - Calgon - 21.08.2010

There's a special callback written for zcmd (in zcmd), it's called OnPlayerCommandReceived. Try move your commands to that.


Re: ZCMD Problems - Sergei - 21.08.2010

Solution is simple.

Change OnPlayerCommandText to some random name (I have ProcessOldCommand). then add ZCMD callbacks to your model:

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    return 1;
}

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) success = ProcessOldCommand(playerid,cmdtext);
    return success;
}
Now add your ZCMD commands and don't mind other commands. You don't even need to delete old commands since ZCMD will have priority anyway.


Re: ZCMD Problems - KingstoN* - 26.08.2010

@Sergei

it works !!


Thank You Very Much !!

Edit:

it's possible with ZCMD?

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys == 128 ))
{
OnPlayerCommandText(playerid, "/engine");
}
}

this command is not in OnPlayerCommandText and is in CMD:engine...

is possible make it with ZCMD?