Anti Deathmatch system
#5

Quote:
Originally Posted by Abagail
View Post
So basically using your code you wish to disable law enforcers from giving damage? And CIV's with no wanted level can't take fall damage?

Here is another example that prevents players from shooting someone if they have less than the shooting / attacking player's score.

pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, weaponid, bodypart)
{
      if(playerid != issuerid && GetPlayerScore(playerid) < GetPlayerScore(issuerid))
      {
               new Float: health;
               GetPlayerHealth(playerid, health+amount);
               SetPlayerHealth(playerid, health);
               return 0;
      }
      return 1;
}
For reference,
playerid - The one taking damage
issuerid - The one issuing damage(to the other player/playerID)
Would this work? To stop law enforcement officers from shooting eachother.

pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, weaponid, bodypart)
{
      if(playerid != issuerid && IsALawEnforcement(playerid) && IsALawEnforcement(issuerid) )
      {
               new Float: health;
               GetPlayerHealth(playerid, health+amount);
               SetPlayerHealth(playerid, health);
               return 0;
      }
      return 1;
}
If you have any other examples, please post it.

Thanks
Reply


Messages In This Thread
Anti Deathmatch system - by FunnyBear - 16.02.2015, 23:21
Re: Anti Deathmatch system - by Abagail - 16.02.2015, 23:31
Re: Anti Deathmatch system - by FunnyBear - 16.02.2015, 23:36
Re: Anti Deathmatch system - by Abagail - 16.02.2015, 23:42
Re: Anti Deathmatch system - by FunnyBear - 16.02.2015, 23:48
Re: Anti Deathmatch system - by Abagail - 16.02.2015, 23:52

Forum Jump:


Users browsing this thread: 1 Guest(s)