Why new users get stats of other players?(ini)
#1

Heey guys,
i made a save system with ini.
But when a new player register he gets stats of other existed player who is not online(deaths and kills etc.):S.
Codes:
Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths,
    pScore,
    pCaptures,
   	God,
   	GodCar,
   	banned,
   	Warnings,
   	pPlayersloggedin,
   	pPlayersregistered

}

public LoadUser_AccountData(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Banned",PlayerInfo[playerid][banned]);
    INI_Int("Warnings",PlayerInfo[playerid][Warnings]);
	INI_Int("Cash",PlayerInfo[playerid][pCash]);
    //INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    PlayerInfo[playerid][pAdmin]=0;
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Score",PlayerInfo[playerid][pScore]);
    INI_Int("Captures",PlayerInfo[playerid][pCaptures]);
    INI_Int("Rank",ranklvl[playerid]);
    INI_Int("PlayersLoggedIn",PlayerInfo[playerid][pPlayersloggedin]);
    INI_Int("PlayersRegistered",PlayerInfo[playerid][pPlayersregistered]);
    return 1;
}
Код:
//onplayerdisconnect
INI_WriteString(File,"Name",name);
	INI_WriteString(File,"Ip",plrIP);
 	INI_WriteInt(File,"Registered",fexist(UserPath(playerid)));
    INI_WriteInt(File,"LoggedIn",IsPlayerConnected(playerid));
    INI_WriteInt(File,"LoggedIn",0);
    INI_WriteInt(File,"Warnings",PlayerInfo[playerid][Warnings]);
    INI_WriteInt(File,"Banned",PlayerInfo[playerid][banned]);
	INI_WriteInt(File,"Ping",GetPlayerPing(playerid));
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",0);
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"Score",GetPlayerScore(playerid));
    INI_WriteInt(File,"Rank",ranklvl[playerid]);
    INI_WriteInt(File,"Captures",capturedzones[playerid]);
    INI_WriteInt(File,"PlayersLoggedIn",playersloggedin);
    INI_WriteInt(File,"PlayersRegistered",playersregistered);
Код:
//onplayerupdate
INI_WriteString(File,"Name",name);
      		INI_WriteInt(File,"Registered",fexist(UserPath(playerid)));
    		INI_WriteInt(File,"LoggedIn",IsPlayerConnected(playerid));
		    INI_WriteInt(File,"PlayersLoggedIn",playersloggedin);
			INI_WriteInt(File,"PlayersRegistered",playersregistered);
			INI_WriteInt(File,"Ping",GetPlayerPing(playerid));
			new plrIP[16];
			GetPlayerIp(playerid, plrIP, sizeof(plrIP));
			INI_WriteString(File,"Ip",plrIP);
		    //INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
		    //INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
		    //INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
		    //INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
		    //INI_WriteInt(File,"Score",GetPlayerScore(playerid));
      		INI_WriteInt(File,"Rank",ranklvl[playerid]);
		    INI_WriteInt(File,"Captures",capturedzones[playerid]);
Код:
//and the last one is the register(dialog)
INI_WriteString(File,"Name",name);
				INI_WriteInt(File,"Password",udb_hash(inputtext));
				INI_WriteString(File,"Ip",plrIP);
 				INI_WriteInt(File,"Registered",1);
  				INI_WriteInt(File,"LoggedIn",1);
		    	INI_WriteInt(File,"Banned",0);
    			INI_WriteInt(File,"Ping",0);
			    INI_WriteInt(File,"PlayersLoggedIn",playersloggedin);
    			INI_WriteInt(File,"PlayersRegistered",playersregistered);
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Score",0);
                INI_WriteInt(File,"Rank",0);
    			INI_WriteInt(File,"Captures",0);
Anyone can help me pls. I really need it.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)