Need a hand guys
#3

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.
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)