GetPlayerSex - 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: GetPlayerSex (
/showthread.php?tid=351766)
GetPlayerSex -
kujox222 - 17.06.2012
Has the GetPlayerSex been created yet? I ask because I have a problem with my stats it won't read the gender by name only number, I need something like this to use to give it the name while it checks the number.
Re: GetPlayerSex -
Extremo - 17.06.2012
Just check what number it is and insert Male or Female into the stats by a string?
pawn Код:
stock GetPlayerSex(sex)
{
return sex?"Male":"Female";
}// something along those lines
There's no such thing however as to "GetPlayerSex".
Re: GetPlayerSex -
kujox222 - 17.06.2012
Quote:
Originally Posted by Extremo
Just check what number it is and insert Male or Female into the stats by a string?
pawn Код:
stock GetPlayerSex(sex) { return sex?"Male":"Female"; }// something along those lines
There's no such thing however as to "GetPlayerSex".
|
Its not that simple.
pawn Код:
public ShowStats(playerid,targetid)
{
new string[250],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
new file[100];
format(file,sizeof(file),PlayerFile);
format(string,sizeof(string),""embed_blue"%s "embed_white"stats\n\
"embed_blue"Age:"embed_white"%d\n\
"embed_blue"Gender:"embed_white"%s\n\
"embed_blue"Race:"embed_white"%s\n\
"embed_blue"Money:"embed_white"$%d\n\
"embed_blue"Kills:"embed_white"%d\n\
"embed_blue"Deaths:"embed_white"%d",
pName,
pInfo[playerid][Age],
pInfo[playerid][Gender] = dini_Get(file,"Gender"),
pInfo[playerid][Race] = dini_Int(file,"Race"),
GetPlayerMoney(playerid),
pInfo[playerid][Kills],
pInfo[playerid][Deaths]);
ShowPlayerDialog(playerid,1234,DIALOG_STYLE_MSGBOX,""embed_white"Stats",string,"Ok","");
return 1;
}
Atm I am trying to get it to read the dini. But thats failing just as bad. As using this.