saving kills;deaths (simple stuff)
#2

I hate DUDB . I'll just make a simple one for you out of DINI because I am bored.

TOP
pawn Код:
new Kills[MAX_PLAYERS];
new Deaths[MAX_PLAYERS];
Under OnGameModeInit
pawn Код:
if(!dini_Exists("Deaths.cfg"))
{
  dini_Create("Deaths.cfg");
}
   
if(!dini_Exists("Kills.cfg"))
{
  dini_Create("Kills.cfg");
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  Kills[killerid]++;
  Deaths[playerid]++;
  return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
  new Pname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, Pname, MAX_PLAYER_NAME);
  Deaths[playerid] = dini_Int("Deaths.cfg", Pname);
  Kills[playerid] = dini_Int("Kills.cfg", Pname);
  return 1;
}
pawn Код:
OnPlayerDisconnect(playerid, reason)
{
  new Pname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, Pname, MAX_PLAYER_NAME);
  dini_IntSet("Deaths.cfg", Pname, Deaths[playerid]);
  dini_IntSet("Kills.cfg", Pname, Kills[playerid]);
}
Simple

The format shown in the file will be:
Код:
NAME = KILLS/DEATHS
Reply


Messages In This Thread
saving kills;deaths (simple stuff) - by klavins - 11.09.2009, 19:38
Re: saving kills;deaths (simple stuff) - by [HiC]TheKiller - 12.09.2009, 00:49
Re: saving kills;deaths (simple stuff) - by x-cutter - 12.09.2009, 03:46
Re: saving kills;deaths (simple stuff) - by Dak_Cobain - 12.09.2009, 04:08
Re: saving kills;deaths (simple stuff) - by Jakku - 12.09.2009, 07:13
Re: saving kills;deaths (simple stuff) - by klavins - 12.09.2009, 08:32
Re: saving kills;deaths (simple stuff) - by [HiC]TheKiller - 12.09.2009, 09:26

Forum Jump:


Users browsing this thread: 3 Guest(s)