Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function preventDM(attacker)
- if (attacker and getElementType(attacker) == "player") then
- local attackerTeam = getTeamName(getPlayerTeam(attacker))
- local sourceTeam = getTeamName(getPlayerTeam(source)) -- source is the player who got damaged
- if (getElementDimension(attacker) == 0 and getElementDimension(source) == 0) then
- if (attackerTeam == "Criminals") then
- if (sourceTeam == "Criminals" or sourceTeam == "Civilian Workers") then
- return false
- end
- return true
- elseif (attackerTeam == "Civilian Workers") then
- if (sourceTeam == "Criminals" or sourceTeam == "Civilian Workers") then
- return false
- end
- return true
- end
- end
- end
- end
- addEventHandler("onClientPlayerDamage", root, preventDM)
Advertisement
Add Comment
Please, Sign In to add comment