SA-MP Forums Archive
How to .. - 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: How to .. (/showthread.php?tid=393564)



How to .. - x96664 - 18.11.2012

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



Re: How to .. - TheArcher - 18.11.2012

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.
}



Re: How to .. - x96664 - 18.11.2012

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!