Need a hand guys
#2

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
Reply


Messages In This Thread
Need a hand guys - by kujox222 - 17.06.2012, 09:29
AW: Need a hand guys - by Nero_3D - 17.06.2012, 09:46
Re: AW: Need a hand guys - by kujox222 - 17.06.2012, 09:59
AW: Re: AW: Need a hand guys - by Nero_3D - 17.06.2012, 10:27
Re: Need a hand guys - by Revo - 17.06.2012, 10:37
Re: AW: Re: AW: Need a hand guys - by kujox222 - 17.06.2012, 10:40

Forum Jump:


Users browsing this thread: 1 Guest(s)