Little help.
#1

Hello,
I don't know what's wrong with this code.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new str[128];
    switch(dialogid)
    {
        case 250:
        {
            if(response)
            {
                if(strval(str) < 1 || strval(str) > 60) return ShowPlayerDialog(playerid,250,DIALOG_STYLE_INPUT,"Test","{FF00EA}Test Age?\n{FF00EA}You're Age Must Be Between 1-60!","Okay","");
                PutPlayerInVehicle(playerid,v_ID,3);
                TogglePlayerControllable(playerid, 1);
                FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,100,10);
                }
            }
        }
    return 1;
}
Am i doing something wrong?
Thank you.
Reply
#2

Quote:
Originally Posted by Hydra_Farrell123
Посмотреть сообщение
if(strval(str) < 1 || strval(str) > 60) return ShowPlayerDialog(playerid,250,DIALOG_STYLE_INPUT," Test","{FF00EA}Test Age?\n{FF00EA}You're Age Must Be Between 1-60!","Okay","("));

Take the last " Out it may work then.
( I have placed a bracket around it.
What?
Reply
#3

No that means there isn't a 2nd button. Do you receive any warnings? If so post them.
Reply
#4

What is the problem?
Reply
#5

There are no any warnings and/or errors.
whenever i type age in my dialog (which is under 60) it says "Your Age Must Be Under 1-60"
Reply
#6

Quote:
Originally Posted by Littlehelper[MDZ]
Посмотреть сообщение
Hello,
I don't know what's wrong with this code.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new str[128];
    switch(dialogid)
    {
        case 250:
        {
            if(response)
            {
                if(strval(str) < 1 || strval(str) > 60) return ShowPlayerDialog(playerid,250,DIALOG_STYLE_INPUT,"Test","{FF00EA}Test Age?\n{FF00EA}You're Age Must Be Between 1-60!","Okay","");
                PutPlayerInVehicle(playerid,v_ID,3);
                TogglePlayerControllable(playerid, 1);
                FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,100,10);
                }
            }
        }
    return 1;
}
Am i doing something wrong?
Thank you.
pawn Код:
if(dialogid == 250)
    {
        if(response)
        {
            SendClientMessage(playerid, COLOR_YELLOW, "Your age? Your age must be between 1-60!");
                        PutPlayerInVehicle(playerid,v_ID,3);
                        TogglePlayerControllable(playerid, 1);
                        FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,100,10);
        }
        return 1;
    }
What is this cmd anyway?
Reply
#7

replace every str with inputtext
Reply
#8

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new str[128];
    switch(dialogid)
    {
        case 250:
        {
            if(response)
            {
                new value = strval(inputtext);
                if(value < 1 || value > 60) return ShowPlayerDialog(playerid,250,DIALOG_STYLE_INPUT,"Test","{FF00EA}Test Age?\n{FF00EA}You're Age Must Be Between 1-60!","Okay","");
                PutPlayerInVehicle(playerid,v_ID,3);
                TogglePlayerControllable(playerid, 1);
                FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,100,10);
            }
        }
    }
    return 1;
}
Reply
#9

Quote:
Originally Posted by AdamCooper
Посмотреть сообщение
pawn Код:
if(dialogid == 250)
    {
        if(response)
        {
            SendClientMessage(playerid, COLOR_YELLOW, "Your age? Your age must be between 1-60!");
                        PutPlayerInVehicle(playerid,v_ID,3);
                        TogglePlayerControllable(playerid, 1);
                        FadeColorForPlayer(playerid,255,0,0,0,255,0,0,255,100,10);
        }
        return 1;
    }
What is this cmd anyway?
Checkpoint.
Reply
#10

Edit: beaten already

Change this:

Код:
if(strval(str) < 1 || strval(str) > 60)
to this:

Код:
if(strval(inputtext) < 1 || strval(inputtext) > 60)
You're declaring str and not doing anything with it, so strval(str) is evaluating to 0.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)