INI_Load
#5

Okay that's weird.
The function is not working when the player is vip level 0.
If player is vip level 1 or 2, 3. The function is working but returning to 0.

This is how i did it.

pawn Код:
else if(fexist(Path(playerid)))
    {
        INI_ParseFile(Path(playerid),"loadaccount_user", .bExtra = true, .extra = playerid);
        if(pInfo[playerid][Vip] >= 1)
        {
            format(str, sizeof(str), ""white"VipMsg: "red"Very Important Player "yellow"%s "white"has been connected!", pName(playerid));
            SendClientMessageToAll(-1, str);
            switch(pInfo[playerid][Vip])
            {
                case 1: rank = #Lvl1;
                case 2: rank = #Lvl2;
                case 3: rank = #Lvl3;
            }
            if(GetPlayerVip(playerid) == 0)
            {
                SendClientMessage(playerid, -1, "test");
                print("VIP 0");
            }
            if(pInfo[playerid][Helper] == 0)
            {
                format(str, sizeof(str), "Welcome back V.I.P. %s, Your current V.I.P. rank is %s - Level %d", rank, pInfo[playerid][Vip]);
                SendClientMessage(playerid, COLOR_YELLOW, str);
            }
            else if(pInfo[playerid][Helper] == 1)
            {
                format(str, sizeof(str), "Welcome back V.I.P./Helper %s, Your current V.I.P. rank is %s - Level %d", rank, pInfo[playerid][Vip]);
                SendClientMessage(playerid, COLOR_YELLOW, str);
            }
        }
    }
Updated

pawn Код:
INI:file5[Accounts](playerid, name[], value[])
{
    INI_Int("VIPLevel", playervip[playerid]);
    return 0;
}

stock GetPlayerVip(playerid)
{
    format(file5, sizeof(file5), VipPath, pName(playerid));
    print("Loaded!");
    INI_Load(file5, true, playerid);
    printf("Results: %d", playervip[playerid]);
    return playervip[playerid];
}
Reply


Messages In This Thread
INI_Load - by JaKe Elite - 17.02.2013, 07:54
Re: INI_Load - by JaKe Elite - 17.02.2013, 08:16
Re: INI_Load - by E_Meec - 17.02.2013, 08:18
Re: INI_Load - by JaKe Elite - 17.02.2013, 08:23
Re: INI_Load - by JaKe Elite - 17.02.2013, 08:30
Re: INI_Load - by JaKe Elite - 17.02.2013, 09:40
Re: INI_Load - by JaKe Elite - 18.02.2013, 08:04

Forum Jump:


Users browsing this thread: 1 Guest(s)