INI_Load
#1

Okay, so i'm trying to make a vip system.

I occur some problems.

pawn Код:
stock GetPlayerVip(playerid)
{
new vipfile[] = Path(playerid);
INI_Load(vipfile);
return results;
}
the problem is.

How can i name it in this part

pawn Код:
INI:Path(playerid)[Accounts](name[], value[])
{
}
Reply
#2

Okay so i found out that it isn't working.

pawn Код:
INI:file5[Accounts](playerid, name[], value[])
{
    if(!strcmp(name, "VIPLevel"))
    {
        playervip[playerid] = strval(value);
    }
}

stock GetPlayerVip(playerid)
{
    format(file5, sizeof(file5), VipPath, pName(playerid));
    print("Loaded!");
    INI_Load(file5);
    printf("Results: %d", playervip[playerid]);
    return playervip[playerid];
}
No debug is showing up in the console.
Reply
#3

Try with INI_ParseFile
Reply
#4

i'm doing the stocks outside the script.
So, what should i gonna do now if i do INI_ParseFile?
I still don't understand y_ini little bit.
Reply
#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
#6

Bump.
Reply
#7

Bump.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)