Help with OnDialogRespone.
#1

Hey im made dialog style list.
and im need help this is the first time i using it, im really dont know what to do,
please fix me

here is the command text:
Код HTML:
COMMAND:musiclist(playerid, params[])
{
    ShowPlayerDialog(playerid, 193060, DIALOG_STYLE_MSGBOX, "Music List", "1 Look at it tonight /n 2 Tacata /n 3 VOL 6 /n 4 Make it harder /n 5 Hardwell", "Confirm", "Cancel");
    return 1;
}
and here is the Dialog respone but im aint want it to do anything just sendclientmessage about how to use it, like /music1-5
when you type /music1 its playing the song 1 - Look at it tonight
and there is one dialog after it so please try to help me with the Pawn im mean the : return 1; and this "{" its hard for me
**ignore the dialog id 1232 just help me with the pawn language, the return 1; and "{" how to fix it and make it right.

Код HTML:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  if(dialogid == 193060)
	{
		if(response)
		{
			new message[256+1];
			if(listitem == 0)
			{
			format(message, 256, "INFO: type /music1-5 to listen to it,", listitem);
		  	SendClientMessage(playerid, 0xFFFFFFFF, message);
 			}
			if(listitem == 1)
			{
			  format(message, 256, "INFO: type /music1-5 to listen to it.", listitem);
			  SendClientMessage(playerid, 0xFFFFFFFF, message);
	return 1;
}

	if(dialogid == 1232)
	{
	    if(response)
	    {
			Catagory[playerid]=DISABLE;
			SetTimerEx("OnPlayerRequestClass", 1000, false, "i", playerid);
		}
		if(!response) SpawnPlayer(playerid);
	}
	if(IsSpawned[playerid]==ENABLE)
	{
   		if(dialogid == DIALOG_ATTACH_INDEX_SELECTION)
        {
            if(response)
            {
Reply
#2

First thing, It's \n not /n, Replace that and try it
Second you have 5 options on the dialog, But you didn't do them..
pawn Код:
if(listitem == 0)
            {
            format(message, 256, "INFO: type /music1-5 to listen to it,", listitem);
            SendClientMessage(playerid, 0xFFFFFFFF, message);
            }
            if(listitem == 1)
            {
              format(message, 256, "INFO: type /music1-5 to listen to it.", listitem);
              SendClientMessage(playerid, 0xFFFFFFFF, message);
Add the missing listitems or remove the options on the dialog
Reply
#3

.................................
Reply
#4

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
First thing, It's \n not /n, Replace that and try it
Second you have 5 options on the dialog, But you didn't do them..
pawn Код:
if(listitem == 0)
            {
            format(message, 256, "INFO: type /music1-5 to listen to it,", listitem);
            SendClientMessage(playerid, 0xFFFFFFFF, message);
            }
            if(listitem == 1)
            {
              format(message, 256, "INFO: type /music1-5 to listen to it.", listitem);
              SendClientMessage(playerid, 0xFFFFFFFF, message);
Add the missing listitems or remove the options on the dialog
Thank's i did it, i replace and fix the dialog.
but i have errors;

Reply
#5

Do this on top of your script
pawn Код:
#pragma tabsize 0
And do this
pawn Код:
new message[128];
Hope it works for you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)