How to ..
#1

Hi, if I'm using only ZCMD processor and I don't use OnPlayerCommandText how can I return
pawn Код:
new string[128];
    format(string, sizeof(string), "{FFFFFF}The command {FF0000}%s {FFFFFF}doesn't exist.\nPlease check the command's list by pressing Commands button!", cmdtext);
    return ShowPlayerDialog(playerid,Dialog_Wrong_Command, DIALOG_STYLE_MSGBOX,"{FFFFFF}You have typed an unknown command:",string,"Commands","Close");
Because I used it here
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
//bla bla stuff
//return 0;//I'm commenting it because it returns Server:Unknown command or whatever was the message, to use this function:
   {
    new string[128];
    format(string, sizeof(string), "{FFFFFF}The command {FF0000}%s {FFFFFF}doesn't exist.\nPlease check the command's list by pressing Commands button!", cmdtext);
    return ShowPlayerDialog(playerid,Dialog_Wrong_Command, DIALOG_STYLE_MSGBOX,"{FFFFFF}You have typed an unknown command:",string,"Commands","Close");
}
}
Reply
#2

Just paste

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    new string[128];
    format(string, sizeof(string), "{FFFFFF}The command {FF0000}%s {FFFFFF}doesn't exist.\nPlease check the command's list by pressing Commands button!", cmdtext);
    ShowPlayerDialog(playerid,Dialog_Wrong_Command, DIALOG_STYLE_MSGBOX,"{FFFFFF}You have typed an unknown command:",string,"Commands","Close");
    return 1;//If player writes command wrong this will still return it as a true.
}
Reply
#3

Quote:
Originally Posted by TheArcher
Посмотреть сообщение
Just paste

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    new string[128];
    format(string, sizeof(string), "{FFFFFF}The command {FF0000}%s {FFFFFF}doesn't exist.\nPlease check the command's list by pressing Commands button!", cmdtext);
    ShowPlayerDialog(playerid,Dialog_Wrong_Command, DIALOG_STYLE_MSGBOX,"{FFFFFF}You have typed an unknown command:",string,"Commands","Close");
    return 1;//If player writes command wrong this will still return it as a true.
}
Thanks for the fast response!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)