Dialog help
#1

Hello here is my problem ::

after I connect and fill in my age & sex info. it kicks me here is the code::

Код:
if(dialogid == DIALOG_AGE)
	{
	    if(!response)
       	{
         	Kick(playerid);
       	}
       	else
       	{
      		if(strlen(inputtext))
		    {
		        new age = strval(inputtext);
		        if(age > 100 || age < 16)
				{
                    ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Age ","How old are you?\n{FF0000}(( 16 - 100 ))","Answer","Quit");
				}
				else
				{
					PlayerInfo[playerid][pAge] = age;
					new
						string[ 64 ]
					;
					format(string, sizeof(string), "INFO: You're {3BB9FF}%d years old.",age);
					SendClientMessage(playerid, -1, string);
					SpawnPlayer(playerid);
					new file[100];
					dini_Create(file);
					dini_IntSet(file, "SEX",PlayerInfo[playerid][pSex]);
					dini_IntSet(file, "AGE",PlayerInfo[playerid][pAge]);
				}
			}
			else
			{
			    return 0;
			}
		}
	}
    if(dialogid == DIALOG_SEX)
	{
	    if(!response)
       	{
         	Kick(playerid);
       	}
       	if(strlen(inputtext))
       	{
       	    PlayerInfo[playerid][pSex] = 1;
			SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}male.");
			ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Select Your Shelter", "Grove Street\nJefferson Motel\nMarket Station","Select","Quit");
			SetPlayerSkin(playerid, 60);
			PlayerInfo[playerid][pSkin] = 60;
			ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
		}
		else
		{
			PlayerInfo[playerid][pSex] = 2;
			SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}female.");
			ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Select Your Shelter", "Grove Street\nJefferson Motel\nMarket Station","Select","Quit");
			SetPlayerSkin(playerid, 233);
			PlayerInfo[playerid][pSkin] = 233;
			ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
   		}
	}
Reply
#2

pawn Код:
if(dialogid == DIALOG_AGE)
    {
        if(!response)
        {
            Kick(playerid);
        }
        else
        {
            if(strlen(inputtext))
            {
                new age = strval(inputtext);
                if(age > 100 || age < 0)
                {
                    ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Age ","How old are you?\n{FF0000}(( 0 - 100 ))","Answer","Quit");
                }
                else
                {
                    PlayerInfo[playerid][pAge] = age;
                    new
                        string[ 64 ]
                    ;
                    format(string, sizeof(string), "INFO: You're {3BB9FF}%d years old.",age);
                    SendClientMessage(playerid, -1, string);
                    SpawnPlayer(playerid);
                    new file[100];
                    dini_Create(file);
                    dini_IntSet(file, "SEX",PlayerInfo[playerid][pSex]);
                    dini_IntSet(file, "AGE",PlayerInfo[playerid][pAge]);
                }
            }
            else
            {
                return 0;
            }
        }
    }
    if(dialogid == DIALOG_SEX)
    {
        if(!response)
        {
            SendClientMessage(playerid, 0xFFFFFFFF, "Change Your Sex!", pname);
        }
        if(strlen(inputtext))
        {
            PlayerInfo[playerid][pSex] = 1;
            SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}male.");
            ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Select Your Shelter", "Grove Street\nJefferson Motel\nMarket Station","Select","Quit");
            SetPlayerSkin(playerid, 60);
            PlayerInfo[playerid][pSkin] = 60;
            ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
        }
        else
        {
            PlayerInfo[playerid][pSex] = 2;
            SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}female.");
            ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Select Your Shelter", "Grove Street\nJefferson Motel\nMarket Station","Select","Quit");
            SetPlayerSkin(playerid, 233);
            PlayerInfo[playerid][pSkin] = 233;
            ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 0 - 100 ))","Answer","Quit");
        }
    }
Try This
Reply
#3

Still same problem you only changed the number of " 16 " minimum to " 0 " minimum , any way thank you for trying
Reply
#4

any help ?
Reply
#5

Show how to you open your dialog? Maybe your responding is conflict with displaying.
Reply
#6

hop this work

pawn Код:
if(dialogid == DIALOG_AGE)
    {
        if(response)
        {
                new age = strval(inputtext);
                if(age < 16 || age > 100)
                {
                    ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Age ","How old are you?\n{FF0000}(( 16 - 100 ))","Answer","Quit");
                    return 1;
                }
                else
                {
                    new string[ 64 ]
                    ;
                    format(string, sizeof(string), "INFO: You're {3BB9FF}%d years old.",age);
                    SendClientMessage(playerid, -1, string);
                    SpawnPlayer(playerid);
                    new file[100];
                    dini_Create(file);
                    dini_IntSet(file, "SEX",PlayerInfo[playerid][pSex]);
                    dini_IntSet(file, "AGE",PlayerInfo[playerid][pAge]);
                    return 1;
                }
        }
        else
        {
            Kick(playerid);
            return 1;
        }
    }
    if(dialogid == DIALOG_SEX)
    {
        if(response)
        {
            PlayerInfo[playerid][pSex] = 1;
            SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}male.");
            ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Select Your Shelter", "Grove Street\nJefferson Motel\nMarket Station","Select","Quit");
            SetPlayerSkin(playerid, 60);
            PlayerInfo[playerid][pSkin] = 60;
            ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
        }
        else
        {
            PlayerInfo[playerid][pSex] = 2;
            SendClientMessage(playerid, -1, "INFO: You are {3BB9FF}female.");
            ShowPlayerDialog(playerid, DIALOG_SPAWN, DIALOG_STYLE_LIST, "Select Your Shelter", "Grove Street\nJefferson Motel\nMarket Station","Select","Quit");
            SetPlayerSkin(playerid, 233);
            PlayerInfo[playerid][pSkin] = 233;
            ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- Age -","How old are you??\n{FF0000}(( 16 - 100 ))","Answer","Quit");
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)