Invalid Command Return - 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 Return (
/showthread.php?tid=299123)
Invalid Command Return -
Thresholdold - 24.11.2011
Hey guys, I really need help with a small script. I need to make the server say "Invalid Command, use /cmds to view the general commands" when a player types a command that doesn't exist. How do I go about doing that? Please help
Re: Invalid Command Return -
Thresholdold - 24.11.2011
Example: A player types "/aasfjjhgas" and the server Sends a Client message "Invalid Command etc."
Re: Invalid Command Return - Max_Coldheart - 24.11.2011
If you're using ZCMD:
pawn Код:
OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) return SendClientMessage(playerid, -1, "Invalid command, use /cmds to view the general commands");
}
Re: Invalid Command Return -
Thresholdold - 24.11.2011
Is there a way I can do this without ZCMD ?? I'm finding ZCMD too difficult...
Re: Invalid Command Return -
Kingunit - 24.11.2011
Quote:
Originally Posted by Threshold
Is there a way I can do this without ZCMD ?? I'm finding ZCMD too difficult...
|
ZCMD is the easiest way ever!
pawn Код:
CMD:HELP(playerid, params[])
{
return 1;
}
Re: Invalid Command Return -
Kostas' - 24.11.2011
he said without ZCMD. If you are using strcmp
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/command", true)) {
// Code Here
return 1;
}
return SendClientMessage(playerid, COLOR, "Invalid Command, use /cmds to view the general commands");;
}