#1

i tried to make my own Include because i wanted to make a FS with something there is in my GM(levels)
so i did this:
Код:
stock PlayerLevel(playerid, level)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new file[256], tmp;
format(file, 256, "MyGameMode/Users/%s.ini", udb_encode(name));
tmp = dini_Int(file, "Level");
if((IsPlayerConnected(playerid)) && tmp >= level)
return true;
else return false;
}
^^this is in my include... what's wrong with it? when i did:
Код:
if(PlayerLevel(playerid, 1))
{
...
...
...
}
else
{
...
}
it didn't work! it always did what i wrote in the "else". plz help! (it suppose to check if the player is level 1 or more
Reply
#2

Try:
pawn Код:
if(PlayerLevel(playerid) == 1)
Reply
#3

pawn Код:
stock GetPlayerLevel(playerid)
{
    if((IsPlayerConnected(playerid))
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        new file[256],level;
        format(file, 256, "MyGameMode/Users/%s.ini", udb_encode(name));
        level = dini_Int(file, "Level");
        return level;
    }
    return -1;
}
CHeck if he is connected first, and than try to get name
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)