So, I'm making a command that will load user activity while he is offline.
The problem is that it always shows 0...
Code:
CMD:aktivnostigraca(playerid, params[])
{
new ime[40];
new string[264], string2[264];
if(PlayerInfo[playerid][pAdmin] < 1337) return SCM(playerid, COLOR_GREY, "[GRESKA] Samo Admini!");
if(sscanf(params, "s[40]", ime)) return SCM(playerid, COLOR_GREY, "[Komanda] /aktivnositgraca [IME_PREZIME]");
new id = GetPlayerID(ime);
if(!IsPlayerConnected(id))
{
format(string,sizeof(string),KORISNICI,ime);
INI_ParseFile(string, "LoadAkt_%s", .bExtra = true, .extra = playerid);
format(string, 264, "| [OFFLINE] Igrac: %s | Admin Aktivnost: %d | GS Aktivnost: %d | Lider Aktivnost: %d |", ime, AdmAkti, GSAkti, LAkti);
SCM(playerid, COLOR_GREY, string);
AdmAkti = 0; GSAkti = 0; LAkti = 0;
}
else
{
format(string, 264, "| [ONLINE] Igrac: %s | Admin Aktivnost: %d | GS Aktivnost: %d | Lider Aktivnost: %d |", ime, PlayerInfo[id][AdmAkt], PlayerInfo[id][GSAkt], PlayerInfo[playerid][LAkt]);
SCM(playerid, COLOR_GREY, string);
}
return true;
}
forward LoadAkt_data(name[],value[]);
public LoadAkt_data(name[],value[])
{
INI_Int("AdmAktivnost", AdmAkti);
INI_Int("GSAktivnost", GSAkti);
INI_Int("LAktivnost", LAkti);
return 1;
}
for online, it loads ok, it saves when player loggs out and loads when he get ig..