Male/Female
#1

Hey Guys.. So i have this code.. and when i do choose the sex it saves as 0 in the text file.
Everything loads well except the sex..
Code:
#define Male 788
#define Female 789

-

     pSex[MAX_SERVER_PLAYERS],

-

Under stats commands..

format(str, sizeof(str), "Score: %d", Account[playerid][pScore]),SendClientMessage(playerid,COLOR_WHITE,str);
format(str, sizeof(str), "Sex: %s", Account[playerid][pSex]),SendClientMessage(playerid,COLOR_WHITE,str);

-

  if(dialogid == 598)
	{
	    if(!response) ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Choose your Sex","Male\nFemale","Choose","Think");
		else if(response)
		{
  			switch(listitem)
            {
                case 0: Account[playerid][pSex] = 788;
                case 1: Account[playerid][pSex] = 789;
            }
     	}
	}

-

if(dialogid == RegistrationDialog){
    if(response==1){
	  Account[playerid][pScore]=GetPlayerScore(playerid);
      Account[playerid][pCash]=GetPlayerMoney(playerid);
      Account[playerid][pLoggedin]=1;
      ShowPlayerDialog(playerid,598,DIALOG_STYLE_LIST,"Choose Your Sex","Male\nFemale","Choose","Think");
etc..     
	return 1;}

-

stock OnPlayerRegister(playerid, params[]){
  new file[MAX_SERVER_STRING],tmp3[100],year,month,day; getdate(year,month,day);
  GetPlayerName(playerid, pname, sizeof(pname));
  format(file, sizeof(file), UsersFile, pname);
  dini_Create(file);
  PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  GetPlayerIp(playerid,tmp3,100);
  dini_IntSet(file, "score", Account[playerid][pScore]);
  dini_IntSet(file, "sex",Account[playerid][pSex]);
etc...

-

stock OnPlayerLogin(playerid){
  GetPlayerName(playerid, pname, sizeof(pname));
  new file[MAX_SERVER_STRING],tmp3[100];format(file,sizeof(file),UsersFile, pname);
  .......
  Account[playerid][pScore]=dini_Int(file,"score");
  Account[playerid][pSex]=dini_Int(file,"sex");
etc...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)