Gender problem
#1

Hi. I have a problem with selecting gender, when i register a new account i select male but in stats it shows me female, but with female everything is ok.... Even in account files i have to change from 0 to 1 so i could be male in-game... Hope this is the right code..

Код:
    if(dialogid == DIALOG_GENDER)
    {
        if(!response)
        {
            SendClientMessage(playerid, GREY, "Please select 'Male' or 'Female' ");
            ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "Are you a male or a female?","Male\nFemale","Next","Quit");
		}
        else if(response)
        {
            switch(listitem)
        	{
        	    case 0:
        	    {
			        SendClientMessage(playerid, GREY, "So, you are a male.");
        	        PlayerStat[playerid][Gender] = 1;
        	        PlayerStat[playerid][LastSkin] = 50;
        	        ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "How old are you?", "Input your age below.", "Next", "Quit");
        	    }
        	    case 1:
        	    {
			        SendClientMessage(playerid, GREY, "So, you are a female.");
        	        PlayerStat[playerid][Gender] = 0;
        	        PlayerStat[playerid][LastSkin] = 191;
        	        ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "How old are you?", "Input your age below.", "Next", "Quit");
        	    }
        	}
        }
    }
Reply
#2

are you sure is case 0: is male ?
Reply
#3

I think it is...
Reply
#4

Someone pleease help me... :/
Reply
#5

Try changing them around then eg.
pawn Код:
if(dialogid == DIALOG_GENDER)
    {
        if(!response)
        {
            SendClientMessage(playerid, GREY, "Please select 'Male' or 'Female' ");
            ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "Are you a male or a female?","Male\nFemale","Next","Quit");
        }
        else if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    SendClientMessage(playerid, GREY, "So, you are a female.");
                    PlayerStat[playerid][Gender] = 0;
                    PlayerStat[playerid][LastSkin] = 191;
                    ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "How old are you?", "Input your age below.", "Next", "Quit");
                }
                case 1:
                {
                    SendClientMessage(playerid, GREY, "So, you are a male.");
                    PlayerStat[playerid][Gender] = 1;
                    PlayerStat[playerid][LastSkin] = 50;
                    ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "How old are you?", "Input your age below.", "Next", "Quit");
                }
            }
        }
    }
Reply
#6

Didnt help..
Reply
#7

Try printing (debugging) and change your title, it is so misleading!
Reply
#8

Post your stats command.
Reply
#9

pawn Код:
public ShowStatsForPlayer(playerid, targetid)
{
    new str[128];
    SendClientMessage(targetid, GREEN, "------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
    format(str, 128, "Name: %s | IP: %s | Gender: %s | Age: %d | In Prison For: %s | Interior: %d | Virtual World: %d.", GetICName(playerid), PlayerStat[playerid][LastIP], GetGender(playerid), PlayerStat[playerid][Age], PlayerStat[playerid][Reason], GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
    SendClientMessage(targetid, GREY, str);
    format(str, 128, "Helper Level: %d | Admin Level: %d | Times Kicked: %d | Times Banned: %d | Warnings: %d (/warnings for more info).", PlayerStat[playerid][HelperLevel], PlayerStat[playerid][AdminLevel], PlayerStat[playerid][TimesKicked], PlayerStat[playerid][TimesBanned], PlayerStat[playerid][Warnings]);
    SendClientMessage(targetid, GREY, str);
    format(str, 128, "Money $%d | Locker Money: $%d | Next Paycheck: $%d | Current Job: %s | Hours Passed in Job: %d.", PlayerStat[playerid][Money], PlayerStat[playerid][LockerMoney], PlayerStat[playerid][Paycheck], GetJob(playerid), PlayerStat[playerid][HoursInJob]);
    SendClientMessage(targetid, GREY, str);
    format(str, 128, "Playing Hours: %d | Gang: %s (ID: %d) | Gang Rank: %s (%d) | Faction: %s | Faction Rank: %s.", PlayerStat[playerid][PlayingHours], GetGangName(playerid), PlayerStat[playerid][GangID], GetGangRank(playerid), PlayerStat[playerid][GangRank], GetFactionName(playerid), GetFactionRank(playerid));
    SendClientMessage(targetid, GREY, str);
    format(str, 128, "Seconds logged in: %d | Pot: %d | Crack: %d | Kills: %d | Deaths: %d  | Health: %f | Armour: %f.", PlayerStat[playerid][SecondsLoggedIn], PlayerStat[playerid][Pot], PlayerStat[playerid][Crack], PlayerStat[playerid][Kills], PlayerStat[playerid][Deaths], PlayerStat[playerid][Health], PlayerStat[playerid][Armour]);
    SendClientMessage(targetid, GREY, str);
    SendClientMessage(targetid, GREEN, "------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------");
If this isnt that you wanted, then just tell me where can i find the right thing that you need..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)