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

Please show your save function.
Reply
#3

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Please show your save function.
PHP код:
#define scriptfiles "/ILSRP/%s.ini" 
PHP код:
Password=232129203
HasCondom
=0
PackCondom
=0
HasCigar
=0
HasPack
=0
PackSnack
=0
AdminLevel
=0
PackCigars
=0
HasSnack
=0
Money
=1500
Score
=1
Skin
=
and here is includes

PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <dudb>
#include <gvar>
#include <time>
#include <dprops>
#include <utils>
#include <dini>
#pragma unused ret_memcpy
#pragma unused strtok 
what u mean?
Reply
#4

The part where you save the players data...
Reply
#5

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Please show your save function.
Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
The part where you save the players data...
this?
PHP код:
format(filesizeof(file), scriptfilesname); 
i forgot to put onplayerconnect
PHP код:
//register /login system
    
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");
     }
    
// 
i think i gave the one were i saved player data
PHP код:
#define scriptfiles "/ILSRP/%s.ini" 
how does it looks like? i am kind new in this
Reply
#6

He means if you have any stock/public where you save the data. example:
pawn Код:
public SaveCharacter()
Reply
#7

Quote:
Originally Posted by Don_Cage
Посмотреть сообщение
He means if you have any stock/public where you save the data. example:
pawn Код:
public SaveCharacter()
i dont have
PHP код:
public SaveCharacter() 
but i found this
PHP код:
stock PlayerInfo(playerid) {
    new 
pname[30], string[40];
    
GetPlayerName(playeridpname30);
    
format(stringsizeof string"%s (%d)"pnameplayerid);
    return 
string;

and this
PHP код:
stock PlayerCash(playeridcash)
{
    
GivePlayerMoney(playeridGetPlayerMoney(playerid) + cash);
    return 
1;

Reply
#8

Oh my god.

Okay, let's try and stoop down to your level.

Show everything that has "scriptfiles" in in it.
Reply
#9

Quote:
Originally Posted by Don_Cage
Посмотреть сообщение
He means if you have any stock/public where you save the data. example:
pawn Код:
public SaveCharacter()
Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Oh my god.

Okay, let's try and stoop down to your level.

Show everything that has "scriptfiles" in in it.
ok i apologies i am new for this type of system
Thank You

#1 - Define
PHP код:
#define scriptfiles "/ILSRP/%s.ini" 
#2 - OnPlayerConnect
PHP код:
//register /login system
    
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");
     } 

OnPlayerDisconnect

PHP код:
new name[MAX_PLAYER_NAME], file[256];
    
GetPlayerName(playeridnamesizeof(name));
    
format(filesizeof(file), scriptfilesname); 
DIALOG_LOGIN
PHP код:
new name[MAX_PLAYER_NAME], file[256];
        
GetPlayerName(playeridnamesizeof(name));
        
format(filesizeof(file), scriptfilesname);
        if(!
response) return Kick(playerid); 
DIALOG_REGISTER
PHP код:
 new name[MAX_PLAYER_NAME], file[256];
        
GetPlayerName(playeridnamesizeof(name));
        
format(filesizeof(file), scriptfilesname); 
THATS ALL
Reply
#10

Oh for fuck sake.

Show your entire OnPlayerDisconnect call.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)