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");
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");
}
}
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.
}
Just paste
pawn Код:
|