Level, exp, kills, deaths
#7

pawn Код:
enum Data
{
  Kills,
  Deaths,
};
new pInfo[MAX_PLAYERS][Data];

public OnPlayerConnect(playerid)
{
  pInfo[playerid][Kills] = 0;
  pInfo[playerid][Deaths] = 0;
  return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
  pInfo[killerid][Kills]++;
  pInfo[playerid][Deaths]++;
  return 1;
}
Heres a example of usage:
pawn Код:
format(str, sizeof(str), "Kills: %s | Deaths: %s", pInfo[playerid][Kills], pInfo[playerid][Deaths]);
With an output that will say: "Kills: 64 | Deaths: 23" (Without the " 's. Numbers will be the amount of kills and deaths that you have at the moment, these numbers are random)
Also if you do not use a save system for these stats, it will reset evry time you connect and just show the kills you have after your connect.
Reply


Messages In This Thread
Level, exp, kills, deaths - by Dainyzxz - 04.03.2010, 05:34
Re: Level, exp, kills, deaths - by [HiC]TheKiller - 04.03.2010, 05:48
Re: Level, exp, kills, deaths - by Lejo - 04.03.2010, 08:19
Re: Level, exp, kills, deaths - by Finn - 04.03.2010, 08:36
Re: Level, exp, kills, deaths - by Dainyzxz - 05.03.2010, 05:40
Re: Level, exp, kills, deaths - by LVFDM - 05.03.2010, 06:53
Re: Level, exp, kills, deaths - by bajskorv123 - 05.03.2010, 08:37
Re: Level, exp, kills, deaths - by Lejo - 05.03.2010, 08:53
Re: Level, exp, kills, deaths - by LVFDM - 05.03.2010, 09:24
Re: Level, exp, kills, deaths - by V1ceC1ty - 05.03.2010, 09:39

Forum Jump:


Users browsing this thread: 1 Guest(s)