nokizorque

Untitled

Apr 9th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function preventDM(attacker)
  2.     if (attacker and getElementType(attacker) == "player") then
  3.         local attackerTeam = getTeamName(getPlayerTeam(attacker))
  4.         local sourceTeam = getTeamName(getPlayerTeam(source)) -- source is the player who got damaged
  5.         if (getElementDimension(attacker) == 0 and getElementDimension(source) == 0) then
  6.         if (attackerTeam == "Criminals") then
  7.             if (sourceTeam == "Criminals" or sourceTeam  == "Civilian Workers") then
  8.                 return false
  9.             end
  10.             return true
  11.         elseif (attackerTeam == "Civilian Workers") then
  12.             if (sourceTeam == "Criminals" or sourceTeam  == "Civilian Workers") then
  13.                 return false
  14.             end
  15.             return true
  16.             end
  17.         end
  18.     end
  19. end
  20. addEventHandler("onClientPlayerDamage", root, preventDM)
Advertisement
Add Comment
Please, Sign In to add comment