dini wont load pCash [Help]
#1

Dini Saving Money Issued
it Wont load cash or save -_-
hello i am working on a gamemode that used to have Pvar saving and loading, i dint like the pvar just cause it wouldnt save when disconnect so now i decided to change it to dini, i made some variable for example HasCondom that will save but the money wont save i have completely updated my dini and the plugins to latest the pwno is converting the files with out n errors here is part of my codes
the variables
PHP код:
enum pInfo
{
    
pPass,
    
pHasCondom,
    
pPackCondom,
    
pCash,
    
Spawned,
}
new 
AccountInfo[MAX_PLAYERS][pInfo]; 
login and register sysytem
PHP код:
new name[MAX_PLAYER_NAME], file[256];
    
GetPlayerName(playeridnamesizeof(name));
    
format(filesizeof(file), scriptfilesname);
     if (!
dini_Exists(file))
    {
        
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT"{9ACD32}ILSR - Register{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)""Register""Quit");
     }
    if(
fexist(file))
    {
        
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT"{9ACD32}ILSRP - Login{FFFFFF}""{FFFFFF}You have rejoined under a registered account\nPlease make sure that all mods are turned off\nPlease enter your password below:\n\n(NOTE: Entering a wrong password, gets you IP blocked){FFFFFF}""Login""Quit");
     } 
on dialog respond to DIALOG_REGISTER AND DIALOG_LOGIN
PHP код:
new string[200];
    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");
            
dini_IntSet(file"Money"GetPlayerMoney(playerid));
            
AccountInfo[playerid][pCash] = dini_Int(file"Money");
        }
    }
    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"Money",AccountInfo[playerid][pCash] = 1500);
        
gPlayerLogged[playerid] = 1;
    }
//End of Register Dialog*/ 
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"Money"AccountInfo[playerid][pCash]);
    }
    for(new 
0sizeof(Objects); i++) ////Xobj
    
{
        if(
Player[playerid][view][i])
        {
            
Player[playerid][view][i] = false;
            
DestroyPlayerObject(playerid,Player[playerid][objid][i]);
        }
    }
    new 
string[200];
    
PLAYERLIST_authed[playerid]=false;
    switch(
reason)
    {
        case 
0format(string200"%s has left the server. (Timeout)"PlayerInfo(playerid));
        case 
1format(string200"%s has left the server. (Left)"PlayerInfo(playerid));
        case 
2format(string200"%s has left the server. (Kicked)"PlayerInfo(playerid));
    }
    
SendClientMessageToAll(COLOR_DEADCONNECTstring);
    
playerCheckpoint[playerid] =0;
     
gPlayerLogged[playerid] = 0;
    
RemoveVariables(playerid);
    return 
1;

i tryed looking result but nun worked
oh and incase here are my includes
PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <dudb>
#include <gvar>
#include <time>
#include <dprops>
#include <utils>
#include <dini> 
my server.cfg
PHP код:
echo Executing Server Config...
lanmode 0
rcon_password 87232
maxplayers 160
port 7780
hostname 
*IronLos Santos RolePlay[Under-Manufacturer!]
gamemode0 1.2
filterscripts
announce 0
query 1
chatlogging 0
weburl www
.sanloscnr.forumotion.com
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
maxnpc 0
logtimeformat 
[%H:%M:%S]
plugins sscanf gvar streamer Whirlpool 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)