I need a kill counter.
#8

Quote:
Originally Posted by Etch ❽ H
Try This (Not Tested) :

Top Of Script :
Код:
new Text:txtKills[MAX_PLAYERS];
new kills[MAX_PLAYERS];
OnPlayerSpawn:
Код:
TextDrawShowForPlayer(playerid,txtKills[playerid]);
Код:
OnPlayerDeath(playerid,kilerid,reason)
{
  new szString[128];
  kills[killerid]++;
  format(szString,sizeof(szString),"Kills :%d",kills[killerid]);
  TextDrawSetString(txtKills[killerid],szString);
  return 1;
}
OnGameModeInit :
Код:
for(new i=0;i<MAX_PLAYERS;i++)
{
  txtKills[i] = TextDrawCreate(11.000000,273.000000,"Kills :0");
  TextDrawAlignment(txtKills[i],0);
  TextDrawBackgroundColor(txtKills[i],0x000000ff);
  TextDrawFont(txtKills[i],1);
  TextDrawLetterSize(txtKills[i],0.699999,1.600000);
  TextDrawColor(txtKills[i],0x00ff0099);
  TextDrawSetOutline(txtKills[i],1);
  TextDrawSetProportional(txtKills[i],1);
  TextDrawSetShadow(txtKills[i],1);
}
Now fixed. You weren't accessing array indexes and it would have only showed one players kills.
Reply


Messages In This Thread
I need a kill counter. - by [MWR]Blood - 08.04.2010, 09:43
Re: I need a kill counter. - by aircombat - 08.04.2010, 10:48
Re: I need a kill counter. - by [MWR]Blood - 08.04.2010, 11:02
Re: I need a kill counter. - by [MWR]Blood - 08.04.2010, 11:15
Re: I need a kill counter. - by aircombat - 08.04.2010, 12:00
Re: I need a kill counter. - by biltong - 08.04.2010, 12:09
Re: I need a kill counter. - by aircombat - 08.04.2010, 12:32
Re: I need a kill counter. - by Simon - 08.04.2010, 12:41

Forum Jump:


Users browsing this thread: 2 Guest(s)