Y_INI Loading problem - Jarnu - 21.09.2012
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?
Re: Y_INI Loading problem -
Lordzy - 21.09.2012
Did you Parse INI?
Re: Y_INI Loading problem - Jarnu - 21.09.2012
Yea i do
---
Re: Y_INI Loading problem - Glint - 21.09.2012
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;
}
Re: Y_INI Loading problem - Jarnu - 21.09.2012
I just want to load VIP Level .. there are no other variables.
Re: Y_INI Loading problem - Glint - 21.09.2012
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.
Re: Y_INI Loading problem - Jarnu - 21.09.2012
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.
Re: Y_INI Loading problem - Glint - 21.09.2012
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)
Re: Y_INI Loading problem - Jarnu - 21.09.2012
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? ..
Re: Y_INI Loading problem - Glint - 21.09.2012
Quote:
Originally Posted by Jarnu
|
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)