saving skinand loading wont work dini
#1

Everything saves exept the skin it wont load or save i dont know why please help me i am confuse i am doing everything rite but just dont know whats the problem here here part of the dini code

ON enum pInfo


PHP код:
enum pInfo
{
    
pPass,
    
pHasCondom,
    
pPackCondom,
    
Money,
    
Spawned,
    
pHasPack,
    
pHasCigar,
    
pPackCigars,
    
pPackSnack,
    
pHasSnack,
    
pAdminLevel,
    
pHasSmoked,
}
new 
AccountInfo[MAX_PLAYERS][pInfo]; 
DIALOG_REGISTER FIRST TIME SET
PHP код:
    if (dialogid == DIALOG_REGISTER)
    {
        
//SetTimerEx("SkipSpawn",3,0,"i",playerid);//It's required to have atleast 1 millisecond
        
new name[MAX_PLAYER_NAME], file[256];
        
GetPlayerName(playeridnamesizeof(name));
        
format(filesizeof(file), scriptfilesname);
        if(!
response) return Kick(playerid);
        if (!
strlen(inputtext)) return
        
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT"{9ACD32}ILSRP - Register{FFFFFF}""{FFFFFF}You have joined under a non registered account\nPlease make sure that all mods are turned off\nPlease enter your password below:\n\n(NOTE: Enter the password you will remember){FFFFFF}""Register""Quit");
        
dini_Create(file);
        
dini_IntSet(file"Password"udb_hash(inputtext));
        
dini_IntSet(file"HasCondom",AccountInfo[playerid][pHasCondom] = 0);
        
dini_IntSet(file"PackCondom",AccountInfo[playerid][pPackCondom] = 0);
        
dini_IntSet(file"HasCigar",AccountInfo[playerid][pHasCigar] = 0); //pHasCigar
        
dini_IntSet(file"HasPack",AccountInfo[playerid][pHasPack] = 0);
        
dini_IntSet(file"PackSnack",AccountInfo[playerid][pPackSnack] = 0);
        
dini_IntSet(file"AdminLevel",AccountInfo[playerid][pAdminLevel] = 0);
        
dini_IntSet(file"PackCigars",AccountInfo[playerid][pPackCigars] = 0);
        
dini_IntSet(file"HasSnack",AccountInfo[playerid][pHasSnack] = 0);
        
dini_IntSet(file"Money"SetPlayerMoney(playerid1500));
           
dini_IntSet(file"Score"SetPlayerScore(playerid1));
           
dini_IntSet(file"Skin"SetPlayerSkin(playerid230)); // this skin
        
gPlayerLogged[playerid] = 1;
    } 
DIALOG_LOGIN LOAD IT
PHP код:
    if (dialogid == DIALOG_LOGIN)
    {
        new 
name[MAX_PLAYER_NAME], file[256];
        
GetPlayerName(playeridnamesizeof(name));
        
format(filesizeof(file), scriptfilesname);
        if(!
response) return Kick(playerid);
        if (!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT"Welcome back!""Welcome back to ILSRP!\n\nType in your password below to login""Login""Leave");
        new 
tmp;
        
tmp dini_Int(file"Password");
        if(
udb_hash(inputtext) != tmp) {
            
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT"Welcome back!""Welcome back to ILSRP!\n\nType in your password below to login""Login""Leave");
        }
        else
        {
            
//SetTimerEx("SkipSpawn",3,0,"i",playerid);//It's required to have atleast 1 millisecond
            
TogglePlayerSpectating(playerid0);
            
gPlayerLogged[playerid] = 1;
            
AccountInfo[playerid][pHasCondom] = dini_Int(file"HasCondom");
            
AccountInfo[playerid][pPackCondom] = dini_Int(file"PackCondom");
            
AccountInfo[playerid][pHasPack] = dini_Int(file"HasPack");
            
AccountInfo[playerid][pHasCigar] = dini_Int(file"HasCigar"); //pHasCigar
            
AccountInfo[playerid][pPackCigars] = dini_Int(file"PackCigar");
            
AccountInfo[playerid][pPackSnack] = dini_Int(file"PackSnack");
            
AccountInfo[playerid][pHasSnack] = dini_Int(file"HasSnack");
            
AccountInfo[playerid][pAdminLevel] = dini_Int(file"AdminLevel");
            
SetPlayerMoney(playeriddini_Int(file"Money"));
            
SetPlayerScore(playeriddini_Int(file"Score"));
            
SetPlayerSkin(playeriddini_Int(file"Skin"));
        }
    } 
and OnPlayerDisconnect
PHP код:
public OnPlayerDisconnect(playeridreason)
{
    new 
name[MAX_PLAYER_NAME], file[256];
    
GetPlayerName(playeridnamesizeof(name));
    
format(filesizeof(file), scriptfilesname);
    if(
gPlayerLogged[playerid] == 1)
    {
        
dini_IntSet(file"HasCondom"AccountInfo[playerid][pPackCondom]);
        
dini_IntSet(file"PackCondom",AccountInfo[playerid][pPackCondom]);
        
dini_IntSet(file"HasPack",AccountInfo[playerid][pHasPack]);
        
dini_IntSet(file"HasCigar",AccountInfo[playerid][pHasCigar]); // pHasCigar
        
dini_IntSet(file"PackCigars",AccountInfo[playerid][pPackCigars]);
        
dini_IntSet(file"PackSnack",AccountInfo[playerid][pPackSnack]);
        
dini_IntSet(file"HasSnack",AccountInfo[playerid][pHasSnack]);
        
dini_IntSet(file"AdminLevel",AccountInfo[playerid][pAdminLevel]);
        
dini_IntSet(file"Money"GetPlayerMoney(playerid));
        
dini_IntSet(file"Score"GetPlayerScore(playerid));
        
dini_IntSet(file"Skin"GetPlayerSkin(playerid));
    } 
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)