anti teamkill question
#1

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

i explained it for you in code with comments...

pawn Код:
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;
}
try to undrestand code
if you have problem with this reply here
good luck
Reply
#3

thanks man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)