Y_INI saving help
#1

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?
Reply
#2

Care to share the codes?
Reply
#3

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...
Reply
#4

do you save stuff in disconnect?
Reply
#5

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.
Reply
#6

do you parse the file on login
Reply
#7

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.
Reply
#8

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!
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)