SA-MP Forums Archive
Invalid Command - 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)
+--- Thread: Invalid Command (/showthread.php?tid=300464)



Invalid Command - Thresholdold - 30.11.2011

Hey guys, I'm trying to create an invalid command return with ZCMD, but it's not working, I have no errors or warnings...

Am I supposed to add this into a new filterscript??

Код:
#include <a_samp>
#include <zcmd>

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success)
{
return SendClientMessage(playerid, -1, "Invalid command, use /cmds to view the general commands");
}
return 1;
}
NOTE: This is the ENTIRE code.


Re: Invalid Command - ElkaBlazer - 30.11.2011

ZCMD doesnt work when you have strcmp ....Do you have strcmp commands in ur gm/fs ?


Re: Invalid Command - Kostas' - 30.11.2011

it works on OnPlayerCommandPerformed(playerid, cmdtext[], success)
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) {
        SendClientMessage(playerid, -1, "Invalid command, use /cmds to view the general commands"
    }
    return 1;
}



Re: Invalid Command - [MG]Dimi - 30.11.2011

Quote:
Originally Posted by ElkaBlazer
Посмотреть сообщение
ZCMD doesnt work when you have strcmp ....Do you have strcmp commands in ur gm/fs ?
No. Wrong. If you have
pawn Код:
#include <zcmd>
included
pawn Код:
OnPlayerCommandText(playerid,cmdtext[])
won't be called.

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid, -1, "Invalid command, use /cmds to view the general commands");
    return 1;
}
Kinda same as yours. You sure it's not working?


Re: Invalid Command - Thresholdold - 30.11.2011

I'm sure... when I type a random command nothing happens...


Re: Invalid Command - Thresholdold - 30.11.2011

The code you gave isn't working


Re: Invalid Command - Thresholdold - 30.11.2011

EDIT: ACCIDENTAL DOUBLE POST :S