Changing Unknow Command
#8

Quote:
Originally Posted by doreto
Посмотреть сообщение
if he have big gamemode on each command he must put ""SendClientMessage(playerid, COLOR,"Bad command, do /help to see all avaible commands");"" bether choise is like Tee say
PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if(!
success)return SendClientMessage(playerid,-1,"That command does not exist, please use /help or /cmds.");
    return 
1;

You are wrong, you don't have to add any line in each command. As you can see the message is the default "return 0;" of "OnPlayerCommandText".

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/help", true))
    {
        //Example
    }
    return 0;
/* Returning '0' is used to inform the server that the command
has not been successfully processed, and passes it to other scripts.
If there hasn't been a successful process, then you will get that
'SERVER: Unknown Command.' error.
*/

}
The code I posted is the natural (and general) way , not everybody uses ZCMD.
Reply


Messages In This Thread
Changing Unknow Command - by ServerScripter - 17.09.2011, 15:13
Re: Changing Unknow Command - by =WoR=Varth - 17.09.2011, 15:15
Re: Changing Unknow Command - by Tee - 17.09.2011, 15:16
Re: Changing Unknow Command - by Xyrex - 17.09.2011, 15:27
Re: Changing Unknow Command - by ServerScripter - 17.09.2011, 16:40
Re: Changing Unknow Command - by doreto - 17.09.2011, 16:48
Re: Changing Unknow Command - by =WoR=Varth - 17.09.2011, 16:53
Re: Changing Unknow Command - by Xyrex - 17.09.2011, 16:57

Forum Jump:


Users browsing this thread: 1 Guest(s)