Guest User

Untitled

a guest
Apr 9th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. function preventDM ( attacker, attacker2 )
  2.     if ( attacker2 ) and ( attacker ) and ( attacker ~= attacker2 ) then
  3.         local attackerTeam = ( getTeamName( getPlayerTeam( attacker ) ) )
  4.         local sourceTeam = ( getTeamName( getPlayerTeam( attacker2 ) ) )
  5.         if ( getElementDimension ( attacker ) == 0 and getElementDimension ( attacker2 ) == 0 ) then
  6.         if ( attackerTeam == "Criminals" ) then
  7.             if ( sourceTeam == "Criminals" ) or ( sourceTeam  == "Civilian Workers" ) then
  8.                 return false
  9.             else
  10.                 return true
  11.             end
  12.         elseif ( attackerTeam == "Civilian Workers" ) then
  13.             if ( sourceTeam == "Criminals" ) or ( sourceTeam  == "Civilian Workers" ) then
  14.                 return false
  15.             else
  16.                 return true
  17.                 end
  18.             end
  19.         end
  20.     end
  21. end
  22. addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), preventDM )
Advertisement
Add Comment
Please, Sign In to add comment