SA-MP Forums Archive
Kills counter HELP! - 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)
+--- Thread: Kills counter HELP! (/showthread.php?tid=366750)



Kills counter HELP! - Melons - 07.08.2012

Hi all i'm working on a kill counter to show each team kills ,i have 2 teams, i use this :
Code:
#define TEAM_GROVE 0
#define TEAM_BALLA 1
new Text:Textdraw0;
new TeamDeaths[2];
OnGamemodeInit
Code:
Textdraw0 = blablabla.....
TeamDeaths[0]=0,
TeamDeaths[1]=0;
OnPlayerConnect
Code:
TextDrawShowForPlayer(playerid, Textdraw0);
OnPlayerDeath
Code:
TeamDeaths[GetPlayerTeam(playerid)]++;
new str[128];
format(str, 128, "Grove: %d Ballas: %d", TeamDeaths[0], TeamDeaths[1]);
TextDrawSetString(Textdraw0, str);
So the problem is that it doesn't work for the ballas ,and it works perfectly for the grove and i don't know what's the problem ,Please help


Re: Kills counter HELP! - 2KY - 07.08.2012

Did you use SetPlayerTeam for the ballas?


Re : Kills counter HELP! - Melons - 07.08.2012

Sorry i didn't undertand ,i'm still learning how to script , can u give me an example ?


Re: Kills counter HELP! - SnG.Scot_MisCuDI - 07.08.2012

pawn Code:
TeamDeaths[0]++;
TeamDeaths[1]++;



Re: Kills counter HELP! - ThePhenix - 07.08.2012

Also if you want to do a Anti-Team_kill system you might add SetPlayerTeam, instead gteam.


Re: Kills counter HELP! - Universal - 07.08.2012

Quote:
Originally Posted by SnG.Scot_MisCuDI
View Post
pawn Code:
TeamDeaths[0]++;
TeamDeaths[1]++;
Whats this?

OT. Have you set players' team? If not, then you should do it by these two methods: https://sampwiki.blast.hk/wiki/SetPlayerTeam, or use this https://sampwiki.blast.hk/wiki/SetSpawnInfo before actually calling SpawnPlayer() function.


Re: Kills counter HELP! - ThePhenix - 07.08.2012

pawn Code:
public OnPlayerSpawn(playerid, teamid)
{
   
    SetPlayerTeam(playerid, 0); //It goes for Grove
    SetPlayerTeam(playerid, 1); //Another team.



    return 1;
}



Re: Kills counter HELP! - mini_mi - 08.08.2012

i have the same probleme


Re : Kills counter HELP! - Melons - 08.08.2012

can anyone help me ,here's an example of wat i need :

it shows each team kills ,Please help