Anti Team Kill? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti Team Kill? (
/showthread.php?tid=197780)
Anti Team Kill? -
nuriel8833 - 10.12.2010
Hello
I was trying to find an Anti Team-Kill system,but I can't find anything.
Can someone please give me one?
Thanks
Nuriel
Re: Anti Team Kill? -
Retardedwolf - 10.12.2010
setPlayerTeam
Re: Anti Team Kill? -
nuriel8833 - 10.12.2010
Quote:
Originally Posted by Hoborific
How do you define your teams?
|
gTeam
The mod is based on Rivershell,so its exacly the same
Any by ATK I mean just when the shoot them the player that was shot won't lose any life
Re: Anti Team Kill? -
[SU]Balli - 10.12.2010
Use under your teleport command to your deathmatch or w/e
SetPlayerTeam(playerid, 1);
under the other teleport command for the other team use
SetPlayerTeam(playerid, 2);
done
Re: Anti Team Kill? -
nuriel8833 - 10.12.2010
Quote:
Originally Posted by [SU]Balli
Use under your teleport command to your deathmatch or w/e
SetPlayerTeam(playerid, 1);
under the other teleport command for the other team use
SetPlayerTeam(playerid, 2);
done
|
Its not deathmatch,it is minigames.
Burt how is setting the player's team going to help?
Re: Anti Team Kill? -
Vince - 10.12.2010
Using SetPlayerTeam disables teamkills completely, and members of the same will not be able to damage each other.
Re: Anti Team Kill? -
Kitten - 10.12.2010
example
pawn Код:
new gTeam[MAX_PLAYERS];
#define team1 0
#define team2 1
onplayerspawn
if(gTeam[playerid] == team1)
{
SetPlayerTeam(playerid,0);
}
else if(gTeam[playerid] == team2)
{
SetPlayerTeam(playerid,1);
}
Re: Anti Team Kill? -
Scenario - 10.12.2010
I'm using
this include to do the following;
pawn Код:
public OnPlayerShootPlayer(shooter, target, damage)
{
new Float:CurHealth;
GetPlayerHealth(target, CurHealth);
if(gTeam[shooter] == TEAM_POLICE && gTeam[target] == TEAM_POLICE)
SetPlayerHealth(target, CurHealth+damage);
return 1;
}
It seems to be doing the job if you ask me.
Re: Anti Team Kill? -
Cypress - 10.12.2010
pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
SetPlayerTeam(playerid, gTeam[playerid]);
}
This works very good on my server.
Re: Anti Team Kill? -
nuriel8833 - 11.12.2010
Quote:
Originally Posted by RealCop228
I'm using this include to do the following;
pawn Код:
public OnPlayerShootPlayer(shooter, target, damage) { new Float:CurHealth; GetPlayerHealth(target, CurHealth); if(gTeam[shooter] == TEAM_POLICE && gTeam[target] == TEAM_POLICE) SetPlayerHealth(target, CurHealth+damage); return 1; }
It seems to be doing the job if you ask me.
|
Yes I have just seen this include in the forum.
I will try everything you gave (or maybe use it all
)
Thank you everybody for helping me!