Quote:
Originally Posted by Nero_3D
If you could tell us where you actually return the "M" or the "F"
The only thing I see is that you call "GetPlayerGender" which is actually a very bad function
Because you could call the code at OnPlayerConnect and only return the gender
pawn Код:
//OnPlayerConnect new tmp[64], ; GetPlayerName(playerid, tmp, MAX_PLAYER_NAME); format(tmp, sizeof tmp, PlayerFile, tmp); // you just could save 1 or 2 instead of "Male" or "Female"... if(strcmp(dini_Get(file,"Gender"), "Male") == 0) { pInfo[playerid][Gender] = Male; } else { pInfo[playerid][Gender] = Female; } // the function stock GetPlayerGender(playerid) { // you could use an array but I am not sure which numbers you assigned to "Male" and "Female" switch(pInfo[playerid][Gender]) { case Male: return "Male"; case Female: return "Female"; } return "Unknown"; }
And switch to a more up to date file system like y_ini
Or use the natives which is always the fastest methode
|
pawn Код:
stock GetPlayerGender(playerid)
{
// you could use an array but I am not sure which numbers you assigned to "Male" and "Female"
switch(pInfo[playerid][Gender])
case 1: return "Male";
case 2: return "Female";
}
return 1;
}
Crashes Pawno. The the assigned numbers are 1 and 2 in the #define area, also I rather prefer dini I don't know why. It already has a Male and Female area in connect. Thats not the issue. The issue is that it ignores the M in Male and am sure it will ignore the Fe in Female.