[Help]Dialog not responding
#1

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;
}
Reply
#2

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. ^^
Reply
#3

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
Reply
#4

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 ('): ('').
Reply
#5

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

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);
Reply
#7

Here you go, should do the trick:

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

NO still show the error
Reply
#9

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)