Help me in dialogs! Pls!! - 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 me in dialogs! Pls!! (
/showthread.php?tid=410489)
Help me in dialogs! Pls!! -
qkac1234 - 25.01.2013
If player write something to the input area and then click on submit, it saves it to the Angle[ 0 ] variable. But this isnt working.
error:
error 046: unknown array size (variable "inputtext")
warning:
warning 215: expression has no effect
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_x)
{
if(response == 1)
{
inputtext=Angle[ 0 ];
}
else
{
SendClientMessage(playerid, 0xEB000FFF, ":(");
}
return 1;
}
return 1;
}
Pls help me!
Re: Help me in dialogs! Pls!! -
DrDoom151 - 25.01.2013
You can try formatting.
pawn Код:
new Float:angle;
format(angle, sizeof(angle), "%f", inputtext);
Re: Help me in dialogs! Pls!! -
qkac1234 - 25.01.2013
still not working... and a new error: error 021: symbol already defined: "format"
Re: Help me in dialogs! Pls!! -
DrDoom151 - 25.01.2013
Where have you put it then?

It's a local function.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new Float:angle;
if(dialogid == DIALOG_x)
{
if(response == 1)
{
format(angle, sizeof(angle), "%f", inputtext);
angle=Angle[ 0 ];
}
else
{
SendClientMessage(playerid, 0xEB000FFF, ":(");
}
return 1;
}
return 1;
}
Re: Help me in dialogs! Pls!! -
qkac1234 - 25.01.2013
no, but if it's a local function, can I get the text in other functions? Outside the ondialogresponse?
I tried this:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_x)
{
if(response == 1)
{
inputtext[20]=x;
}
else
{
SendClientMessage(playerid, 0xEB000FFF, ":(");
}
return 1;
}
return 1;
}
But still not good. Now complied, but isnt working in the game...
I'll try your idea.
Re: Help me in dialogs! Pls!! -
DrDoom151 - 25.01.2013
If it's a local function you can't get it in other functions, since it's local. You'll need to use a global variable/array to use it outside of OnDialogResponse. What are you trying to do? Like what should x do?