Team kill
#1

How to make Team kill? if a player on the same team can lost health.by team killing.
Reply
#2

pawn Код:
#include a_samp

new gTeam[MAX_PLAYERS]; ///define 0 and 1 the team
new Kills[MAX_PLAYERS];



public OnPlayerDeath(playerid, killeird, reason)
{
    if(gTeam[killeird] == gTeam[playerid] )
   {
   Kills[killeird]--;
   SetPlayerHealth(killerid, 0);
   } else { Kills[killeird]++; }

    return 1;
}

or use

SetPlayerTeam
SetTeamCount
Reply
#3

Код:
C:\Users\(967) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

Cesars's code fixed, try this:
Код:
#include a_samp

new gTeam[MAX_PLAYERS]; ///define 0 and 1 the team
new Kills[MAX_PLAYERS];



public OnPlayerDeath(playerid, killerid, reason)
{
    if(gTeam[killerid] == gTeam[playerid]){
		Kills[killerid]--;
   		SetPlayerHealth(killerid, 0);
   	}
    else {
		Kills[killerid]++;
	}

    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)