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

Hey,

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

Thanks.
Reply
#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
#3

dini is so slow.
something else?
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)