Team Death Match
#1

How make a team death match where players can't kill their team players?
Reply
#2

SetPlayerTeam does that.
Reply
#3

Use OnPlayerShootPlayer for anti-teamattack
Use OnPlayerDeath for anti-teamKILL

like:
// OnPlayerDeath

if(GetPlayerTeam(killerid) == GetPlayerTeam(playerid))
{
SetPlayerHealth(killerid, -15);
SendClientMessage(killerid, RED, "You've been killed for killing a team mate! ");
SendClientMessage(playerid, RED, "You've been teamkilled. Position restored ");
}

do the rest code GetPlayerPos, SetPlayerpos and weapons and stuff.
Reply
#4

forum.sa-mp.com/showthread.php?t=346614
Reply
#5

use SetPlayerTeam

Code:
#define Team1 0
#define Team2 1


//OnPlayerSpawn
if(gTeam[playerid] == Team1)
{
 SetPlayerTeam(playerid,Team1);
}
else if(gTeam[playerid] == Team2)
{
 SetPlayerTeam(playerid,Team2);
}
Like this you can add more teams ...

Edit:
oops didnt see the date of thread...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)