Anti-Team kill check
#1

Ok i was looking around the samp forum to find an anti-team kill. So this team kill should take no damage to a player on the attackers team and they said "Use SetPlayerTeam" so i used it but im not sure if my code will work. So can you guys check my code.

my code:

pawn Код:
if(gTeam[killerid] == gTeam[playerid]) {
    SetPlayerTeam(playerid, (What do i add here?)  );
    }


Thanks Lorenc, sorry for the awful grammar, in a rush :P
Reply
#2

u use a number. setplayerteam surposes anti team kill D:

SetPlayerTeam(playerid,1);
Reply
#3

OnPlayerConnect or Class regusest or even onplayerplawn

SetPlayerTeam(playerid,YourTeam);

it good if player get team when he is choosing skins, just small advice
Reply
#4

also u can just do it like gteams #define TEAMNAMEHERE 1 so u dont gotta be doing stupid one's
Reply
#5

#define ATTACK 1
#define DEFENCE 0

if(GetPlayerTeam(playerid) == ATTACK && GetPlayerTeam(killerid) == ATTACK){
SetPlayerTeam(killerid,DEFENCE);
}

if(GetPlayerTeam(playerid) == DEFENCE && GetPlayerTeam(killerid) == DEFENCE){
SetPlayerTeam(killerid,ATTACK);
}
Reply
#6

pawn Код:
SetPlayerTeam(killerid, GetPlayerTeam(playerid));
Might work. Why does everybody uses gTeam instead of GetPlayerTeam with SetPlayerTeam if the purpose is anti-teamkill?
Reply
#7

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
pawn Код:
SetPlayerTeam(killerid, GetPlayerTeam(playerid));
Might work. Why does everybody uses gTeam instead of GetPlayerTeam with SetPlayerTeam if the purpose is anti-teamkill?
I hope to hell it works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)