Posts: 277
Threads: 40
Joined: Sep 2012
Reputation:
0
Hi i have made anti team kill for CopsNRobbers with OnPlayerTakeDamage.
But is not work.
I want anti team kill for the teams CIA FBI POLICE.
For Civilians i dont want team kill.
Please help me.
Posts: 871
Threads: 114
Joined: May 2014
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Man, just use SetPlayerTeam. It has this stuff built in.
Posts: 277
Threads: 40
Joined: Sep 2012
Reputation:
0
I try but i cant man.
See:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(GetPlayerTeam(issuerid) == GetPlayerTeam(playerid))
{
new Float:h;
GetPlayerHealth(playerid,h);
SetPlayerHealth(playerid,h+amount);
GameTextForPlayer(issuerid,"Don't shoot your team",2000,3);
return 1;
}else if(GetPlayerTeam(issuerid) == Civilians){
return 1;
}
}
return 1;
}
Posts: 277
Threads: 40
Joined: Sep 2012
Reputation:
0
@Konstantinos
I have made this now can you tell me if work?
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(GetPlayerTeam(issuerid) == GetPlayerTeam(playerid))
{
new Float:h;
GetPlayerHealth(playerid,h);
SetPlayerHealth(playerid,h+amount);
GameTextForPlayer(issuerid,"Don't shoot your team",2000,3);
return 1;
}else if(GetPlayerTeam(issuerid) == GetPlayerTeam(playerid) && GetPlayerTeam(playerid) == Civilians){
return 1;
}
}
return 1;
}
Posts: 871
Threads: 114
Joined: May 2014
Just use SetPlayerTeam
its more simple
Posts: 277
Threads: 40
Joined: Sep 2012
Reputation:
0
Rappy i have try this but is work for all team.
This i want is to work for all teams but without civilians.