SA-MP Forums Archive
Help with Zcmd - 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: Help with Zcmd (/showthread.php?tid=249872)



Help with Zcmd - mitosking - 20.04.2011

Hello. First, I'm Italian and sorry for my bad english :P... I have one problem. How to make equal command with different name? Example:

CommandText:

Код:
if(!strcmp("/hello", cmdtext, true) || !strcmp("/hi", cmdtext, true))
{
SendClientMessage(playerid, white, "Hello and welcome to this server!");
return 1;
}
And ZCMD? If I add "||" pawno give me some error.


Re: Help with Zcmd - xir - 20.04.2011

pawn Код:
COMMAND:hello(playerid, params[])
{
    SendClientMessage(playerid, white, "Hello and welcome to this server!");
    return 1;
}
pawn Код:
COMMAND:hi(playerid, params[])
{
    return cmd_hello(playerid, params);
}
Enjoy


Re: Help with Zcmd - mitosking - 20.04.2011

Ahaha... thank! I try return CMD_hello, but give me the errore "Undefinied symbol CMD_hello". Damned case sensitive xD. Thank again!


Re: Help with Zcmd - mitosking - 20.04.2011

mmmm yes... It's better than "{}". Thanks to you too =)


Re: Help with Zcmd - mitosking - 20.04.2011

Yes, I see... No problem.... for me :P


Re: Help with Zcmd - mitosking - 21.04.2011

Ehm... I have a problem. How toggle "Unknown Command" with ZCMD when a command doesn't exist?


Re: Help with Zcmd - Alby Fire - 21.04.2011

Quote:
Originally Posted by mitosking
Посмотреть сообщение
Ehm... I have a problem. How toggle "Unknown Command" with ZCMD when a command doesn't exist?
Quote:
Originally Posted by Las Venturas CNR
Посмотреть сообщение
You mean how to use like your own message? I don't think it's possible, because ZCMD supposedly disables OnPlayerCommandText.
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success) {
    if(!success) return SendClientMessage(playerid, 0xff000000, "Example of custom message");
    return true;
}



Re: Help with Zcmd - Gertin - 21.04.2011

Unknown Command comes because you don't have right returns . Try to use return 1.


Re: Help with Zcmd - Alby Fire - 21.04.2011

Quote:
Originally Posted by Gertin
Посмотреть сообщение
Unknown Command comes because you don't have right returns . Try to use return 1.
God... if you don't even know what are we talking about, please.. shut up.


Re: Help with Zcmd - mitosking - 21.04.2011

Thanks Alby ... (loool)