17.06.2012, 09:46
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
And switch to a more up to date file system like y_ini
Or use the natives which is always the fastest methode
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";
}
Or use the natives which is always the fastest methode