needing Anti-Team Killing
#1

hi.. i need help.

i need something in my gamemode

i don't have gTeam, but i need to make Anti-Team Killing

I putted everything.. but didn't put anti-team killing

pls reply.. and help me!

but please help me!
Reply
#2

SetPlayerTeam makes it so that you cant kill your own team .
Reply
#3

but i didn't set player team..
Reply
#4

Set it then.
Reply
#5

Isn't there is a way doesn't let A player for example: If a player have a skin 107, he can not kill skin 106, not team System, do there is a way to?
Reply
#6

Yes, use server-sided health with OnPlayerTakeDamage and deny the damage if a certain condition is met.
Reply
#7

well.. Give me something uh.. a pawn Code? With examples and etc? pls!! Pleaseeeeee
Reply
#8

put this under OnPlayerDeath

Код:
if(gTeam[killerid] == gTeam[playerid]) {
            //punish him

	}
Reply
#9

Option #1, and recommended - using SetPlayerTeam.
Option #2 is as someone said above my post, you can detect TK in OnPlayerTake/GiveDamage, for example:
pawn Код:
// under OnPlayerGiveDamage
if(gTeam[killerid] == gTeam[playerid])
{
    new Float:h;
    GetPlayerHealth(damagedid,h);
    SetPlayerHealth(damagedid,h+amount);
}
I'm not really sure if it's gonna work well, but that's the basic code.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)