Stats Won't Save...
#1

Player Stats won't save..
So this is how its defined in my script:

That's on login dialog response:

Quote:

SetPVarInt(playerid, "Logged", 1);
SetTimer("CheckStats",500,1);
//for(new i; i < GetMaxPlayers(); i++){ CheckStats(i);}
SetPlayerScore(playerid, dini_Int(file, "score"));
SetPlayerMoney(playerid, dini_Int(file, "money"));
PlayerInfo[playerid][AdminLevel]=dini_Int(file,"AdminLevel");
PlayerInfo[playerid][Bombs]=dini_Int(file,"Bombs");
PlayerInfo[playerid][PainKillers]=dini_Int(file,"PainKillers");
PlayerInfo[playerid][Level]=dini_Int(file,"Level");
PlayerInfo[playerid][Kills]=dini_Int(file,"Kills");
PlayerInfo[playerid][Deaths]=dini_Int(file,"Deaths");
PlayerInfo[playerid][RemoteBombs]=dini_Int(file,"RemoteBombs");

This is the public(Timer) CheckStats:

Quote:

public CheckStats(playerid)
{
dini_IntSet(file, "money", GetPlayerMoney(playerid));
dini_IntSet(file, "AdminLevel", (PlayerInfo[playerid][AdminLevel]));
dini_IntSet(file, "score", GetPlayerScore(playerid));
dini_IntSet(file, "Bombs", (PlayerInfo[playerid][Bombs]));
dini_IntSet(file, "PainKillers", (PlayerInfo[playerid][PainKillers]));
dini_IntSet(file, "Kills", (PlayerInfo[playerid][Kills]));
dini_IntSet(file, "Deaths", (PlayerInfo[playerid][Deaths]));
dini_IntSet(file, "Level", (PlayerInfo[playerid][Level]));
dini_IntSet(file, "RemoteBombs", (PlayerInfo[playerid][RemoteBombs]));
return 1;
}

Reply
#2

You need to define file.

pawn Код:
new playername[24];
GetPlayerName(playerid, playername, 24);
format(file, sizeof(file), "%s.ini", playername);
Reply
#3

i already have it defined
new file[128];
OnDialogResponse:
format(file, 128, "%s.ini", GetName(playerid));
Reply
#4

You need to define it in public CheckStats(playerid) too.
Reply
#5

I did now, let me test it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)