What is the best way to save '.ini' file?
#2

Use dini and variables

pawn Код:
new Kills[MAX_PLAYERS], Deaths[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
  Kills[killerid] ++;
  Deaths[playerid] ++;
  return 1;
}

public OnPlayerConnect(playerid)
{
  new Pname[24];
  GetPlayerName(playerid, Pname, 24);
  Kills[playerid] = dini_Int("Kills.ini", Pname);
  Deaths[playerid] = dini_Int("Deaths.ini", Pname);
  GivePlayerMoney(playerid, dini_Int("Money.cfg", Pname));
  return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
  new Pname[24];
  GetPlayerName(playerid, Pname, 24);
  dini_IntSet("Kills.ini", Pname, Kills[playerid]);
  dini_IntSet("Deaths.ini", Pname, Deaths[playerid]);
  dini_IntSet("Money.ini", Pname, GetPlayerMoney(playerid));
  return 1;
}
Reply


Messages In This Thread
What is the best way to save '.ini' file? - by -PunisheR- - 29.12.2009, 07:27
Re: What is the best way to save '.ini' file? - by [HiC]TheKiller - 29.12.2009, 07:41
Re: What is the best way to save '.ini' file? - by -PunisheR- - 29.12.2009, 08:05
Re: What is the best way to save '.ini' file? - by Retardedwolf - 29.12.2009, 08:12
Re: What is the best way to save '.ini' file? - by dice7 - 29.12.2009, 09:10

Forum Jump:


Users browsing this thread: 2 Guest(s)