SA-MP Forums Archive
What is the best way to save '.ini' file? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What is the best way to save '.ini' file? (/showthread.php?tid=116507)



What is the best way to save '.ini' file? - -PunisheR- - 29.12.2009

Hey,

I want to save the kills,deaths,money etc.. but I want to know the best way to do that.

Thanks.



Re: What is the best way to save '.ini' file? - [HiC]TheKiller - 29.12.2009

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;
}



Re: What is the best way to save '.ini' file? - -PunisheR- - 29.12.2009

dini is so slow.
something else?


Re: What is the best way to save '.ini' file? - Retardedwolf - 29.12.2009

http://forum.sa-mp.com/index.php?topic=71125.0


Re: What is the best way to save '.ini' file? - dice7 - 29.12.2009

https://sampwiki.blast.hk/wiki/File_Functions