SA-MP Forums Archive
Y_INI saving help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Y_INI saving help (/showthread.php?tid=396879)



Y_INI saving help - 69 - 02.12.2012

Whenever I add new saves to my Y_INI (I just added factions and fightstyle for example), the file doesn't load. It just creates the password and thats it.
How to fix?


Re: Y_INI saving help - Lordzy - 02.12.2012

Care to share the codes?


Re : Re: Y_INI saving help - 69 - 02.12.2012

Quote:
Originally Posted by Lordz™
Посмотреть сообщение
Care to share the codes?
PHP код:
enum PlayerInfo
{
    
Pass[129],
    
Adminlevel,
    
VIPlevel,
    
Money,
    
Scores,
    
Kills,
    
Deaths,
    
Skin,
    
FightStyle,
    
Faction,

PHP код:
public loadaccount_user(playeridname[], value[])
{
    
INI_String("Password"pInfo[playerid][Pass],129);
    
INI_Int("AdminLevel",pInfo[playerid][Adminlevel]);
    
INI_Int("VIPLevel",pInfo[playerid][VIPlevel]);
    
INI_Int("Money",pInfo[playerid][Money]);
    
INI_Int("Scores",pInfo[playerid][Scores]);
    
INI_Int("Kills",pInfo[playerid][Kills]);
    
INI_Int("Deaths",pInfo[playerid][Deaths]);
    
INI_Int("Skin",pInfo[playerid][Skin]);
    
INI_Int("FightStyle",pInfo[playerid][FightStyle]);
    
INI_Int("Faction",pInfo[playerid][Faction]);
    return 
1;

Register dialog:
PHP код:
            INI_WriteString(file,"Password",hashpass);
            
INI_WriteInt(file,"AdminLevel",0);
            
INI_WriteInt(file,"VIPLevel",0);
            
INI_WriteInt(file,"Money",50);
            
INI_WriteInt(file,"Scores",0);
            
INI_WriteInt(file,"Kills",0);
            
INI_WriteInt(file,"Deaths",0);
            
INI_WriteInt(file,"Skin",299);
            
INI_WriteInt(file,"FightStyle",4);
            
INI_WriteInt(file,"Faction",0); 
That's what it looks like right now.
I got get values in playerspawn etc...


Re: Y_INI saving help - [HK]Ryder[AN] - 02.12.2012

do you save stuff in disconnect?


Re : Re: Y_INI saving help - 69 - 02.12.2012

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
do you save stuff in disconnect?
Yep. But that's not the point, it's upon registration, nothing loads.


Re: Y_INI saving help - [HK]Ryder[AN] - 02.12.2012

do you parse the file on login


Re : Re: Y_INI saving help - 69 - 02.12.2012

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
do you parse the file on login
Yes. As I said, this only happened when I added the two last saves.


Re: Y_INI saving help - Ballu Miaa - 02.12.2012

Follow this Tutorial by Kush and am sure you will be able to fix each and every single problem in your script.

Use your player enum and save and load using the same structure. But make sure you dont miss any variable on saving / loading!


Re : Re: Y_INI saving help - 69 - 02.12.2012

Quote:
Originally Posted by ******
Посмотреть сообщение
There's no tags in that code.
If you mean this then yes there is.
PHP код:
            INI_SetTag(file,"PLAYER"); 



Re: Y_INI saving help - [HK]Ryder[AN] - 02.12.2012

since you are setting the tag..are you doing it on both register and login?