06.12.2014, 19:06
Im trying to make my own anti team kill but what i want is. if the shooter and the target is on same team i want the shooter life to decrease each time they shoot a team mate.
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) //>call when someone takes damage.
{
if(issuerid != INVALID_PLAYER_ID && playerid != INVALID_PLAYER_ID)
{
if(GetPlayerTeam(playerid) == GetPlayerTeam(issuerid)) //> If issuerid (who gives damage) and playerid (who taked damage) was same
{
new Float:AttackerHP; //>Variable for get issuer id health amount
GetPlayerHealth(issuerid, AttackerHP); //>Get it
SetPlayerHealth(issuerid, AttackerHP-10.0); //>decrease 10% of his health ...
}
}
return 1;
}