Deaths dont save.
#1

Hi all,i've a problem...deaths dont save.Here is what variables server save when someone /register.

Код:
	  dini_Create(file);
			  dini_IntSet(file,"Password", udb_hash(tmp));
			  dini_IntSet(file,"AdminLevel", 0);
			  dini_IntSet(file,"Cash", 0);
			  dini_IntSet(file,"Score", 0);
			  dini_IntSet(file,"Deaths", deaths[playerid]);
And login:

Код:
	new playername[MAX_PLAYER_NAME];
				 	SetPlayerMoney(playerid, dini_Int(file, "Cash"));
				 	SetPlayerScore(playerid, dini_Int(file, "Score"));
				 	deaths[playerid] = dini_Int(udb_encode(playername), "deaths");
					PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
And this is OnPlayerDisconnect added values:

Код:
 new file[256];
    new playername[24];
    new name[MAX_PLAYERS];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"%s.ini",name);
    dini_IntSet(file,"AdminLevel",PlayerInfo[playerid][AdminLevel]);
    dini_IntSet(file,"Cash",GetPlayerMoney(playerid));
    dini_IntSet(file,"Score",GetPlayerScore(playerid));
    deaths[playerid] = dini_Int(udb_encode(playername), "deaths");
And i've added:

Код:
new deaths[MAX_PLAYERS];
On the top of the gm.
Reply
#2

BUMP,it's pretty urgent...
Reply
#3

pawn Код:
new file[256];
    new playername[24];        
    new name[MAX_PLAYERS];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"%s.ini",name);
    dini_IntSet(file,"AdminLevel",PlayerInfo[playerid][AdminLevel]);
    dini_IntSet(file,"Cash",GetPlayerMoney(playerid));
    dini_IntSet(file,"Score",GetPlayerScore(playerid));
    deaths[playerid] = dini_Int(file, "deaths"); // changed line... you putted playrname instead of file

//at the login the same
deaths[playerid] = dini_Int(file, "deaths");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)