Help me in dialogs! Pls!!
#1

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!
Reply
#2

You can try formatting.

pawn Код:
new Float:angle;
format(angle, sizeof(angle), "%f", inputtext);
Reply
#3

still not working... and a new error: error 021: symbol already defined: "format"
Reply
#4

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

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.
Reply
#6

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)