Finding out a players age
#1

Alright i have my login and register code done but im unsure how to continue on from that to make my code find the age of the player could anyone help? im sure it would be just in the register place so heres my register part.

Код:
case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if (response)
            {
                if(!strlen(inputtext)) {
                ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""WHITE"Registering",""RED"You have entered an invalid password.\n"WHITE"Type your password below to register a new account.","Register","Quit");
                }

                if(INI_Open(getINI(playerid))) {
                INI_WriteString("pass", inputtext);
				INI_WriteInt("Age", strval(inputtext));
				INI_WriteInt("Cash", StartingCash);
				INI_WriteInt("Score",1);
				INI_WriteInt("Kills", 0);
				INI_WriteInt("Deaths", 0);
				INI_WriteInt("Timeplayed", 0);
				INI_WriteString("Ipaddress", "NEEDS SETTING");
				INI_WriteString("Saveposition", "NEEDS SETTING");
				INI_WriteInt("Admin", 0);
				INI_WriteInt("Faction", 0);
				INI_WriteInt("Faction", 0);
				INI_WriteInt("Bankdeposit", 0);
				INI_WriteInt("Banned", 0);
				INI_WriteString("Banreason", "");
				INI_WriteInt("House", 0);
				INI_WriteInt("Biz", 0);
				INI_WriteInt("Fightstyle", 0);
                INI_Save();
                INI_Close();

                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login.","Login","Quit");
            }
        }
    }
Thanks for any help given
REGARDS MATTHEW
Reply
#2

In what variable did you save player's age?
Reply
#3

Im asking where do i add it in im not sure where to put it =S
Reply
#4

Do you have a dialog where you ask a player how old is he?
Reply
#5

not yet no this is what i am asking how would i go about adding it
Reply
#6

Here is the example:
pawn Код:
ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Your age", "Type in how old are you.", "Next", "Cancel"); // Show age dialog

case DIALOG_AGE: { // In the OnDialogResponse callback
    if (response) {
        PlayerInfo[playerid][pAge] = strval(inputtext); // Your variable to save player's age
       
        // Here you write player's age in his file
        if (INI_Open(getINI(playerid))) INI_WriteInt("Age", strval(inputtext));
               
        INI_Save();
        INI_Close();
    } else Kick(playerid);
}
Reply
#7

Cheers
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)