29.07.2011, 07:35
Here's something I wrote that might be helpful. (Using dini)
At the top, with other variables:
Now:
Saving stats when player disconnects;
_______
Please reputation +, if this helped
-Kane
At the top, with other variables:
pawn Код:
new Kills[MAX_PLAYERS];
new Deaths[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
Kills[playerid]=0;
Deaths[playerid]=0;
new file[128];
format(file, sizeof(file), "%s.ini", GetName(playerid));
if(!fexist(file)
{
dini_Create(file)
dini_IntSet(file, "Kills", 0);
dini_IntSet(file, "Deaths", 0);
Kills[playerid] = dini_Int(file, "Kills");
Deaths[playerid] = dini_Int(file, "Deaths");
}
else
{
Kills[playerid] = dini_Int(file, "Kills");
Deaths[playerid] = dini_Int(file, "Deaths");
}
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new file[128];
format(file, sizeof(file), "%s.ini", GetName(playerid));
dini_IntSet(file, "Kills", Kills[playerid]);
dini_IntSet(file, "Deaths", Deaths[playerid]);
return 1;
}
_______
Please reputation +, if this helped
-Kane