iZCMD + Dialog = Unkown Command?
#1

I have no idea why I'm getting this message, the dialog won't show up as well.

Код:
#define DIALOG_TEST 700

CMD:test(playerid, params[])
{
	ShowPlayerDialog(playerid, DIALOG_TEST, DIALOG_STYLE_MSGBOX, "Test Dialog", "Da da da", "OK", " ");
	return 1;
}
All the other commands are working perfectly.
Reply
#2

You have to script under the "OnDialogResponse" either.
Reply
#3

Make sure you don't have "public OnPlayerCommandText(playerid)" if you are using ZCMD.
Reply
#4

Quote:
Originally Posted by saffierr
Посмотреть сообщение
You have to script under the "OnDialogResponse" either.
I do.

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_TEST)
    {
        if(response)
        {
            SendClientMessage(playerid, -1, "That's cool");
        }
        else
        {
            Kick(playerid);
        }
        return 1;
    }
    return 0;
}
Quote:
Originally Posted by Tammy
Посмотреть сообщение
Make sure you don't have "public OnPlayerCommandText(playerid)" if you are using ZCMD.
I am aware of this, I am only using the OnPlayerCommandPerformed callback.

That's why I find this to be extremely odd, there are no errors, nothing.
Reply
#5

Try this

PHP код:
CMD:test(playeridparams[])
{
    
ShowPlayerDialog(playeridDIALOG_TESTDIALOG_STYLE_MSGBOX"Test Dialog""Da da da""OK""");
    return 
CMD_SUCCESS;

Reply
#6

Actually passing empty string to Button2 param causing command crash.
Simply use this:
PHP код:
CMD:test(playeridparams[])
{
    
ShowPlayerDialog(playeridDIALOG_TESTDIALOG_STYLE_MSGBOX"Test Dialog""Da da da""OK""");
    return 
true;

Reply
#7

Nope, both still give out "Unknown Command", and the dialog doesn't show up.

Код:
CMD:test(playerid, params[])
{
	ShowPlayerDialog(playerid, DIALOG_TEST, DIALOG_STYLE_MSGBOX, "Test Dialog", "Da da da", "OK", "");
	return true;
}

CMD:test2(playerid, params[])
{
	ShowPlayerDialog(playerid, DIALOG_TEST, DIALOG_STYLE_MSGBOX, "Test Dialog", "Da da da", "OK", "");
	return CMD_SUCCESS;
}
Update: I just made a new GameMode, with just those 2 commands and the OnDialogResponse callback, and it works. Does that mean that I have something on my current script that interferes with the command? I have no idea of what could it be.
Reply
#8

Try this one in your current script i think this code will work
Код:
CMD:test(playerid, params[])
{
	new str[1000];
	format(str, sizeof(str), "Da da da");
	ShowPlayerDialog(playerid, DIALOG_TEST, DIALOG_STYLE_MSGBOX, "Test Dialog", str, "Ok", "");
	return 1;
}
Reply
#9

Quote:
Originally Posted by ProDude
Посмотреть сообщение
Try this one in your current script i think this code will work
Код:
CMD:test(playerid, params[])
{
	new str[1000];
	format(str, sizeof(str), "Da da da");
	ShowPlayerDialog(playerid, DIALOG_TEST, DIALOG_STYLE_MSGBOX, "Test Dialog", str, "Ok", "");
	return 1;
}
Hmmm using this much string for this "Da da da" ? Even 15 would be a good to go.

Quote:
Originally Posted by Cepillado
Посмотреть сообщение
Nope, both still give out "Unknown Command", and the dialog doesn't show up.

Код:
CMD:test(playerid, params[])
{
	ShowPlayerDialog(playerid, DIALOG_TEST, DIALOG_STYLE_MSGBOX, "Test Dialog", "Da da da", "OK", "");
	return true;
}

CMD:test2(playerid, params[])
{
	ShowPlayerDialog(playerid, DIALOG_TEST, DIALOG_STYLE_MSGBOX, "Test Dialog", "Da da da", "OK", "");
	return CMD_SUCCESS;
}
Update: I just made a new GameMode, with just those 2 commands and the OnDialogResponse callback, and it works. Does that mean that I have something on my current script that interferes with the command? I have no idea of what could it be.
Yes, there is something wrong in your gamemode.
Reply
#10

Quote:
Originally Posted by ProDude
Посмотреть сообщение
Try this one in your current script i think this code will work
Код:
CMD:test(playerid, params[])
{
	new str[1000];
	format(str, sizeof(str), "Da da da");
	ShowPlayerDialog(playerid, DIALOG_TEST, DIALOG_STYLE_MSGBOX, "Test Dialog", str, "Ok", "");
	return 1;
}
Same deal, Unknown Command. I'm guessing the issue is with another command (even though I only have about 3 more) or the place in which the command is placed, as I said already, in a clean script it works perfectly (despite the fact that I literally copied it)

And, as Karan007 said, 1000 cells are quite a lot for that string.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)