Kills counter HELP!
#1

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
Reply
#2

Did you use SetPlayerTeam for the ballas?
Reply
#3

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

pawn Code:
TeamDeaths[0]++;
TeamDeaths[1]++;
Reply
#5

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

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

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



    return 1;
}
Reply
#8

i have the same probleme
Reply
#9

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

it shows each team kills ,Please help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)