changing server unknown command help
#1

ok i wana change it because when i type a invaild command nothing comes up nd ppl gettin confused and i changed it and when i type a vaild command the command works but it also says invaild command how do i make it so vaild commands dont say invaild command

thx
Reply
#2

If it says invalid command after you type a valid command, it means that you haven't added a return 1; to complete the command. For example:

pawn Код:
public OnPlayerCommandText(playerid,cmdtext[]);
{
    if(strcmp(cmdtext,"/rofl",true) == 0)
    {
        //Stuff in your command...
        return 1; // We add this at the very end of the command, this stops further execution of code in the callback OnPlayerCommandText
    }
    return SendClientMessage(playerid,red,"Command is not correct!");
}
Hope that helps

Additional note: Returning 0 in OnPlayerCommandText will tell the client that the command is wrong and automatically send a message saying Invalid Command!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)