Invalid Command Return
#1

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
Reply
#2

Example: A player types "/aasfjjhgas" and the server Sends a Client message "Invalid Command etc."
Reply
#3

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");
}
Reply
#4

Is there a way I can do this without ZCMD ?? I'm finding ZCMD too difficult...
Reply
#5

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;
}
Reply
#6

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");;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)