SA-MP Forums Archive
iZCMD + Dialog = Unkown Command? - 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: iZCMD + Dialog = Unkown Command? (/showthread.php?tid=597345)



iZCMD + Dialog = Unkown Command? - Cepillado - 29.12.2015

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.


Re: iZCMD + Dialog = Unkown Command? - saffierr - 30.12.2015

You have to script under the "OnDialogResponse" either.


Re: iZCMD + Dialog = Unkown Command? - Tamy - 30.12.2015

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


Respuesta: Re: iZCMD + Dialog = Unkown Command? - Cepillado - 30.12.2015

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.


Re: iZCMD + Dialog = Unkown Command? - Karan007 - 30.12.2015

Try this

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




Re: iZCMD + Dialog = Unkown Command? - iKarim - 30.12.2015

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;




Respuesta: iZCMD + Dialog = Unkown Command? - Cepillado - 30.12.2015

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.


Re: iZCMD + Dialog = Unkown Command? - ProDude - 30.12.2015

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



Re: iZCMD + Dialog = Unkown Command? - Karan007 - 30.12.2015

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.


Respuesta: Re: iZCMD + Dialog = Unkown Command? - Cepillado - 30.12.2015

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.