SA-MP Forums Archive
[Help]Dialog not responding - 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: [Help]Dialog not responding (/showthread.php?tid=489303)



[Help]Dialog not responding - cr33d - 21.01.2014

I made new TD, i want when click on it to show dialog for playing songs form url. I made this, but it is not reposnding IG.

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_PUSTIMUZIKU)
    {
           new url = strval(inputtext);
           if(sscanf(inputtext, "i", url)) return ShowPlayerDialog(player,DIALOG_PUSTIMUZIKU,DIALOG_ STYLE_INPUT,                                     ""ZUTA"Pustanje", "Unesite URL [DIRECT LINK] Pesme", "Pusti", "Izlaz");
    {
     StopAudioStreamForPlayer(player);
      PlayAudioStreamForPlayer(player,inputtext);
    }
    }
return 1;
}
and fisrt dialog on player click on td (it isnot responding)
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Textdraw[16]) ShowPlayerDialog(playerid, DIALOG_PUSTIMUZIKU, DSI, "Music", "Unesite link pesme koju zelite da pustite u prozoru koji Vam se pojavi!\n/MUZIKA", "OK", "Izlaz" );
return 1;
}



Re: [Help]Dialog not responding - Hansrutger - 21.01.2014

if(clickedid == Textdraw[16]) ShowPlayerDialog(playerid, DIALOG_PUSTIMUZIKU, DSI, "Music", "Unesite link pesme koju zelite da pustite u prozoru koji Vam se pojavi!\n/MUZIKA", "OK", "Izlaz" );

into

Код:
if(clickedid == Textdraw[16]) return ShowPlayerDialog(playerid, DIALOG_PUSTIMUZIKU, DSI, "Music", "Unesite link pesme koju zelite da pustite u prozoru koji Vam se pojavi!\n/MUZIKA", "OK", "Izlaz" );
You forgot to return the dialog. ^^


Re: [Help]Dialog not responding - cr33d - 21.01.2014

haahahah i solve thank but i have got new problem with cmd for changing song name:
************************************************** ****************
CMD:imepesme(playerid, params[],help)
{
//#pragma unused help
//#pragma unused params
new songname,string[256];
if(sscanf(params, "ud", songname)) return SendClientMessage(playerid, -1, "SA:RP Pomoc | "ZUTA"/imepesme [IME PESME UPISITE]");
format(string, sizeof(string),"%s",GetName(songname));
PlayerTextDrawSetString(songname,Textdraw[1][songname],string);
return 1;
}
************************************************** ***********************
PAWNO send mi this errors
warning 213: tag mismatch
error 001: expected token: ",", but found "["
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
fatal error 107: too many error messages on one line


Re: [Help]Dialog not responding - Hansrutger - 21.01.2014

Change "ud" to "i" in your sscanf. And lol change the SendClientM to this:

Код:
SendClientMessage(playerid, -1, "SA:RP Pomoc | ''ZUTA''/imepesme [IME PESME UPISITE]");
Never use (") in SCM's third argument, instead use two ('): ('').


Re: [Help]Dialog not responding - PowerPC603 - 22.01.2014

Or use this: \"
The backslash will indicate the next character must be included as text.


Re: [Help]Dialog not responding - cr33d - 22.01.2014

No he still send me errors with this code:
Код:
if(dialogid == PESMA_NAZIV)
	{
		if(!response) return 1;
		if(response)
		{
			new imepesme,string[256];
			imepesme = strval(inputtext);
			if(sscanf(inputtext, "i", imepesme)) return SPD(playerid, PESMA_NAZIV, DIALOG_STYLE_INPUT, "PESMA Ime", "Upisite novo ime pesme\n", "Promeni", "Izlaz");
			format(string, sizeof(string),"Postavili ste ime pesme na %s",GetName(imepesme));
			PlayerTextDrawSetString(playerid,Textdraw[1][imepesme]),string);
		}
	}
Error:
Код:
(428) : warning 213: tag mismatch
(428) : error 001: expected token: ",", but found "["
(428) : error 029: invalid expression, assumed zero
(428) : warning 215: expression has no effect
(428) : error 001: expected token: ";", but found "]"
(428) : fatal error 107: too many error messages on one line
Line 428 only:
Код:
PlayerTextDrawSetString(playerid,Textdraw[1][playerid]),string);



Re: [Help]Dialog not responding - Hansrutger - 22.01.2014

Here you go, should do the trick:

pawn Код:
PlayerTextDrawSetString(playerid, Textdraw[1][playerid], string);



Re: [Help]Dialog not responding - cr33d - 22.01.2014

NO still show the error


Re: [Help]Dialog not responding - Hansrutger - 22.01.2014

Show me your Textdraw attribute (the variable where you declared it: new Textdraw[..) Can't really see why this is happening you.


Re: [Help]Dialog not responding - cr33d - 22.01.2014

This is that TD:
Quote:

Textdraw[1] = TextDrawCreate(21.000000, 143.000000, "Od vina");
TextDrawBackgroundColor(Textdraw[1], 16711935);
TextDrawFont(Textdraw[1], 2);
TextDrawLetterSize(Textdraw[1], 0.270000, 1.299999);
TextDrawColor(Textdraw[1], -1);
TextDrawSetOutline(Textdraw[1], 0);
TextDrawSetProportional(Textdraw[1], 1);
TextDrawSetShadow(Textdraw[1], 0);
TextDrawUseBox(Textdraw[1], 1);
TextDrawBoxColor(Textdraw[1], -16776961);
TextDrawTextSize(Textdraw[1], 191.000000, 34.000000);
TextDrawSetSelectable(Textdraw[1], 0);

i put him in public OnGameModeInit () under first bracket of course