Team Death Match - 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: Team Death Match (
/showthread.php?tid=138293)
Team Death Match -
Patrikas - 01.04.2010
How make a team death match where players can't kill their team players?
Re: Team Death Match -
Carlton - 01.04.2010
SetPlayerTeam does that.
Re: Team Death Match -
Gangs_Rocks - 29.05.2012
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.
Re: Team Death Match -
davve95 - 29.05.2012
forum.sa-mp.com/showthread.php?t=346614
Re: Team Death Match -
Sufyan - 29.05.2012
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...