Y_INI Loading problem
#1

My script saves perfect OnPlayerDisconnect
and Loads perfect OnPlayerConnect...
Код:
[ACCOUNT]
Level = 3
Rank = Donator Level 3
Saves like above.

But when i restart or re-load my Filterscript it just doesn't loads the player level even the account Level and Rank is saved after the disconnect.

also it works perfect till i don't re-load the filterscript.

Can anyone help?
Reply
#2

Did you Parse INI?
Reply
#3

Yea i do

---
Reply
#4

Quote:
Originally Posted by Jarnu
Посмотреть сообщение
Yea i do
pawn Код:
public OnPlayerConnect(playerid)
{
    Enablevheal[playerid] = 1; //Enabling the /vheal command on player connect--
    Enablevbonus[playerid] = 1; //Enabling the /vbonus command on player connect
    HasSpawnedCar[playerid] = 0;//-Setting the value to 0
    //-------------Checking and creating the player account in database---------
    if(fexist(getACC(playerid)))
    {
       new string[256];
       INI_ParseFile(getACC(playerid),"loadvip_%s",.bExtra = true, .extra = playerid);
       format(string, sizeof(string),"Welcome %s Your VIP level has been successfully loaded [VIP Level: %d][VIP Rank: %s]",PlayerName(playerid),PlayerInfo[playerid][pVIP],Rank(playerid));
       print("\n----------------------------------------------------------");
       printf("_____[%s] Very Important Player Connected_____", PlayerName(playerid));
       print("------------------------------------------------------------\n");
       SendClientMessage(playerid, GREEN,string);
    }
    else
    {
       MakeACC(playerid); //Creating the account if the account doesn't exists
    }
    return 1;
}
pawn Код:
public loadvip_acc(playerid, name[], value[])
{
    new vipacc;
    INI_Int("Level", vipacc);
    PlayerInfo[playerid][pVIP] = vipacc;
    return 1;
}
You are only loading the level when Parsing!, where are your other variables that you want to load and also don't create a new variable for it make it like this :
pawn Код:
public loadvip_acc(playerid, name[], value[])
{
    INI_Int("Level", PlayerInfo[playerid][pVIP]);
   /* Your other variables you want to load add it here */
    return 1;
}
Reply
#5

I just want to load VIP Level .. there are no other variables.
Reply
#6

Quote:
Originally Posted by Jarnu
Посмотреть сообщение
I just want to load VIP Level .. there are no other variables.
Ok then use the example i gave you above it works.
Reply
#7

I already said that it works perfect when i re-connect.. but it doesn't works when i reload my FilterScript or

Restart the server.
Reply
#8

Quote:
Originally Posted by Jarnu
Посмотреть сообщение
I already said that it works perfect when i re-connect.. but it doesn't works when i reload my FilterScript or

Restart the server.
I am not sure never used y_ini in a filterscript however, maybe because we are Parsing player's file when he connects and when you re-load the filterscript OnPlayerConnect doesn't get called because the player is already connected (i am not sure)
Reply
#9

It worked totally perfect when i used https://sampforum.blast.hk/showthread.php?tid=379108 it uses SII .. but as i heared that SII is slower than Y_INI i converted everything to Y_INI but now its not working .. :S

Please any solution? ..
Reply
#10

Quote:
Originally Posted by Jarnu
Посмотреть сообщение
It worked totally perfect when i used https://sampforum.blast.hk/showthread.php?tid=379108 it uses SII .. but as i heared that SII is slower than Y_INI i converted everything to Y_INI but now its not working .. :S

Please any solution? ..
That is because SII doesn't parse files it normally Loads them OnPlayerConnect (again not sure about that fact i will need to check it :P)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)