STRING PROBLEM
#4

Quote:
Originally Posted by Lynn
Посмотреть сообщение
I'm pretty sure that will still only display it as, [Gender:] 1 or [Gender:] 2.
Could be wrong :P

pawn Код:
public MyDialogStatsSystem(playerid)
{
    if(PlayerInfo[playerid][pSex] == 1)
    {
        new String[128], Name[MAX_PLAYER_NAME], Cash = GetPlayerMoney(playerid), Score = GetPlayerScore(playerid), 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]: Male  [Age]: %d", Name, Name, Score, Cash, 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
    }
    else if(PlayerInfo[playerid][pSex] == 2)
    {
        new String[128], Name[MAX_PLAYER_NAME], Cash = GetPlayerMoney(playerid), Score = GetPlayerScore(playerid), 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]: Female  [Age]: %d", Name, Name, Score, Cash, 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;
}
Not positive, but I think this should work.
Did it from memory, Haven't used Pawno in quite some time, a bit rusty.
BTW ignore my first post, i didnt watch it closely
and yea yours works, i prefer:
Код:
new GenderName[][32] =
{
        {""},
	{"Male"},
	{"Female"}
};

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]: %s  [Age]: %d", Name, Name, Score, Cash, GenderName[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;
}
oh and watch the values at PlayerInfo[playerid][pSex] = 2;
male should be:
Код:
PlayerInfo[playerid][pSex] = 1;
female should be:
Код:
PlayerInfo[playerid][pSex] = 2;
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)