STRING PROBLEM
#1

pawn Код:
if(RegistrationStep[playerid] == 2)
    {
        new tmp[4];
        if(!strlen(text)) //Check to make sure there is at least 1 character input
        {
            SendClientMessage(playerid,LIGHTBLUE,"What is your Sex?");
            SendClientMessage(playerid,WHITE,"Hint: Enter male or female");
            return 0;
        }
        if(!strcmp("male", tmp, true, 4))
        {//Checks to see if the input matches "female" and if it does continues
            PlayerInfo[playerid][pSex] = strval(text);
            PlayerInfo[playerid][pSex] = 2;
            SendClientMessage(playerid,LIGHTBLUE,"Ok, so you are a male.");
            SendClientMessage(playerid,WHITE,"Thank you for filling in the information");
            RegistrationStep[playerid] = 3;
            TogglePlayerControllable(playerid,1);//Unfreezes the player and play resumes
            return 0;
        }
        else if(!strcmp("female", tmp, true, 6))
        {//Checks to see if the input matches "female" and if it does continues
            PlayerInfo[playerid][pSex] = strval(text);
            PlayerInfo[playerid][pSex] = 2;
            SendClientMessage(playerid,LIGHTBLUE,"Ok, so you are a Female.");
            SendClientMessage(playerid,WHITE,"Thank you for filling in the information");
            RegistrationStep[playerid] = 3;
            TogglePlayerControllable(playerid,1);//Unfreezes the player and play resumes
            return 0;
        }
        else
        { SendClientMessage(playerid,WHITE,"Please answer your Gender!"); return 0; }
    }
pawn Код:
public MyDialogStatsSystem(playerid)
{
    new String[128], Name[MAX_PLAYER_NAME], Cash = GetPlayerMoney(playerid), Score = GetPlayerScore(playerid), Gender = PlayerInfo[playerid][pSex], Age = PlayerInfo[playerid][pAge]; // String, Name, Geld, und Score angelegt.
    GetPlayerName(playerid,Name,sizeof Name);
    format(String, sizeof(String), "[Stats of %s]\n[Nickname]: %s  [Level]: %d  [Money]: %d  [Gender]: %d  [Age]: %d", Name, Name, Score, Cash, Gender, Age); // Unsere (New's) die wir oben neu angelegt haben - immer mit einem , trennen :5
    ShowPlayerDialog(playerid, DIALOG_STATS, 0, "My stats", String, "Close", " "); // Цffne das Dialog fenster beim Spieler
    return 1;
}
Is the code. My problem is, when I do /stats there shows the Gender a value ("0") and not male or Female. How can I fix that? please help!
Reply


Messages In This Thread
STRING PROBLEM - by NuggaN_ - 13.12.2010, 21:54
Re: STRING PROBLEM - by notime - 13.12.2010, 21:56
Re: STRING PROBLEM - by Lynn - 13.12.2010, 22:00
Re: STRING PROBLEM - by notime - 13.12.2010, 22:06
Re: STRING PROBLEM - by NuggaN_ - 13.12.2010, 22:07
Re: STRING PROBLEM - by Lynn - 13.12.2010, 22:12
Re: STRING PROBLEM - by blackwave - 13.12.2010, 22:12
Re: STRING PROBLEM - by NuggaN_ - 13.12.2010, 22:16
Re: STRING PROBLEM - by Lynn - 13.12.2010, 22:21
Re: STRING PROBLEM - by NuggaN_ - 13.12.2010, 22:26

Forum Jump:


Users browsing this thread: 1 Guest(s)