Player Data Failing to Save After Updating Includes
#1

I was updating my pawno\include folder and deleted all the includes (there was a ton of includes I didn't believe were required) and started fresh with the updated includes.

(!)My gamemode finally complied and all seemed well. However, player data is now failing to save and I've tried fixing it myself but I can't find the problem. I'm assuming I am missing an essential include which I cannot recover :/


My includes: http://i.imgur.com/jJuxu7n.png

My plugins: http://i.imgur.com/68SOYU2.png

PHP код:
#include <a_samp>
#include <YSI\y_ini>
#include <zcmd>
#include <sscanf2>
#include "../include/gl_common.inc" 
PHP код:
enum PlayerInfo
{
    
Pass[129],
    
Adminlevel,
    
Premlevel,
    
CharSkin,
    
CharMoney,
    
CharScore,
    
CharKills,
    
CharDeaths,
    
IsJailed,

PHP код:
forward loadaccount_user(playeridname[], value[]);
public 
loadaccount_user(playeridname[], value[])
{
    
printf("%s -> %s"namevalue);
    
INI_String("Password"pInfo[playerid][Pass], 129);
    
INI_Int("Adminlevel" ,pInfo[playerid][Adminlevel]);
    
INI_Int("Premlevel"pInfo[playerid][Premlevel]);
    
INI_Int("CharSkin"pInfo[playerid][CharSkin]);
    
INI_Int("CharMoney"pInfo[playerid][CharMoney]);
    
INI_Int("CharScore"pInfo[playerid][CharScore]);
    
INI_Int("CharKills"pInfo[playerid][CharKills]);
    
INI_Int("CharDeaths"pInfo[playerid][CharDeaths]);
    
INI_Int("IsJailed"pInfo[playerid][IsJailed]);
    return 
1;

PHP код:
public OnPlayerConnect(playerid)
{
        
format(string2sizeof(string2), "{A9C4E4}# [Server] %s {EAEAEA}has connected to the server."GetName(playerid));
        
SendClientMessageToAll(COLOR_SERVER ,string2);
        
SetTimerEx("ClearScreen"1false"i"playerid);
        
        new 
string1[300]; new registerid; new loginid; new name[MAX_PLAYER_NAME];
        
GetPlayerName(playeridnamesizeof(name));
        if(
fexist(Path(playerid)))
        {
        
INI_ParseFile(Path(playerid), "loadaccount_%s", .bExtra true, .extra playerid);
        
format(string1sizeof(string1), "{EAEAEA}Enter your password below to login!"GetName(loginid), loginid);
        
ShowPlayerDialog(playeridLOGIN_DIALOGDIALOG_STYLE_PASSWORD"{A9C4E4}Server {EAEAEA}- Login:"string1"Login""Quit");
        }
        else
        {
        
format(stringsizeof(string), "{EAEAEA}Enter a password below to register!"GetName(registerid), registerid);
        
ShowPlayerDialog(playeridREGISTER_DIALOGDIALOG_STYLE_PASSWORD"{A9C4E4}Server {EAEAEA}- Register:"string"Register""Quit");
        return 
1;
        } 
PHP код:
stock save(playerid)
{
    new 
INI:file INI_Open(Path(playerid));
    
INI_SetTag(file"Character");
    
INI_WriteInt(file"Adminlevel"pInfo[playerid][Adminlevel]);
    
INI_WriteInt(file"Premlevel"pInfo[playerid][Premlevel]);
    
INI_WriteInt(file"CharSkin"pInfo[playerid][CharSkin]);
    
INI_WriteInt(file"CharMoney"GetPlayerMoney(playerid));
    
INI_WriteInt(file"CharScore"GetPlayerScore(playerid));
    
INI_WriteInt(file"CharKills"pInfo[playerid][CharKills]);
    
INI_WriteInt(file"CharDeaths"pInfo[playerid][CharDeaths]);
    
INI_WriteInt(file"IsJailed"pInfo[playerid][IsJailed]);
    
INI_Close(file);
    return 
1;

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == REGISTER_DIALOG)
    {
        if(!
response)return Kick(playerid);
        if(
response)
        {
            if(!
strlen(inputtext))
            {
            new 
string[300];
            new 
registerid;
            
format(stringsizeof(string), "{EAEAEA}Hello, {A9C4E4}%s{EAEAEA}.\n\nPlease enter a password below."GetName(registerid));
            
ShowPlayerDialog(playeridREGISTER_DIALOGDIALOG_STYLE_PASSWORD"{A9C4E4}Server {EAEAEA}- Register:"string"Register""Quit");
            return 
1;
            }
            new 
hashpass[129];
            
WP_Hash(hashpasssizeof(hashpass), inputtext);
            new 
INI:file INI_Open(Path(playerid));
            
INI_SetTag(file"Character");
            
INI_WriteString(file"Password"hashpass);
            
INI_WriteInt(file"Adminlevel"0);
            
INI_WriteInt(file"Premlevel"0);
            
INI_WriteInt(file"CharSkin"60);
            
INI_WriteInt(file"CharMoney"15000);
            
INI_WriteInt(file"CharScore"1);
            
INI_WriteInt(file"CharKills"1);
            
INI_WriteInt(file"CharDeaths"1);
            
INI_WriteInt(file"IsJailed"0);
            
INI_Close(file);
            new 
rstring[200];
            new 
registerid;
            
format(rstringsizeof(rstring), "{A9C4E4}Server {EAEAEA}- You have successfully registered, {A9C4E4}%s{EAEAEA}!"GetName(registerid));
            
SendClientMessage(playeridCOLOR_SERVER"Reminder: {EAEAEA}The server is currently underdevelopment - You might experience bugs");
            
SendClientMessage(playeridCOLOR_GREENrstring);
            
muted[playerid] = 0;
            return 
1;
        }
    }
    if(
dialogid == LOGIN_DIALOG)
    {
        if(!
response)return Kick(playerid);
        if(
response)
        {
            new 
hashpass[129];
            
WP_Hash(hashpasssizeof(hashpass), inputtext);
            if(!
strcmp(hashpasspInfo[playerid][Pass]))
            {
                new 
loginid playerid;
                new 
lstring[300];
                
INI_ParseFile(Path(playerid), "loadaccount_%s", .bExtra true, .extra playerid);
                
SetPlayerScore(playeridpInfo[playerid][CharScore]);
                
GivePlayerMoney(playeridpInfo[playerid][CharMoney]);
                
format(lstringsizeof(lstring), "{EAEAEA}Welcome Back, {A9C4E4}%s{EAEAEA}. {EAEAEA}You have successfully logged in!"GetName(loginid));
                
SendClientMessage(playeridCOLOR_SERVER"Reminder: {EAEAEA}The server is currently underdevelopment - You might experience bugs");
                
SendClientMessage(playeridCOLOR_GREENlstring);
                
muted[playerid] = 0;
            }
            else
            {
                   new 
string1[300];
                
format(string1sizeof(string1), "{EAEAEA}Enter your password below to login!"GetName(playerid), playerid);
                
ShowPlayerDialog(playeridLOGIN_DIALOGDIALOG_STYLE_PASSWORD"{A9C4E4}Server - {EAEAEA}Login:"string1"Login""Quit");
                
SendClientMessage(playeridCOLOR_RED"{ff6347}Error: Wrong Password!");
            }
        }
        return 
1// We handled a dialog, so return 1. Just like OnPlayerCommandText.
    
}
    return 
0// You MUST return 0 here! Just like OnPlayerCommandText.

Also; the .ini file(s) update after changes ingame (admin, kills etc) but gmx and reconnecting they all will reset.

Any suggestions/solutions?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)