SA-MP Forums Archive
Gender problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Gender problem (/showthread.php?tid=428036)



Gender problem - DerViL - 04.04.2013

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");
        	    }
        	}
        }
    }



Re : Gender problem - DaTa[X] - 04.04.2013

are you sure is case 0: is male ?


Re: Gender problem - DerViL - 04.04.2013

I think it is...


Re: Gender problem - DerViL - 04.04.2013

Someone pleease help me... :/


Re: Gender problem - BigGroter - 04.04.2013

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");
                }
            }
        }
    }



Re: Gender problem - DerViL - 04.04.2013

Didnt help..


Re: Gender problem - RajatPawar - 04.04.2013

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


Re: Gender problem - SuperViper - 04.04.2013

Post your stats command.


Re: Gender problem - DerViL - 04.04.2013

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..