Anti Team Kill?
#1

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

setPlayerTeam
Reply
#3

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

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

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?
Reply
#6

Using SetPlayerTeam disables teamkills completely, and members of the same will not be able to damage each other.
Reply
#7

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);
}
Reply
#8

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

pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
SetPlayerTeam(playerid, gTeam[playerid]);
}
This works very good on my server.
Reply
#10

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!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)