Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function preventDM(attacker)
- if (attacker and attacker.type == "player" or attacker.type == "vehicle" and attacker ~= source) then
- if (attacker.dimension == 0 and source.dimension == 0) then
- return false
- end
- if (attacker.type == "vehicle") then
- local driver = attacker.controller
- if (isElement(driver) and driver.type == "player" and driver ~= source) then
- attacker = driver
- end
- end
- if ((attacker.type == "player" and attacker.team.name == "Criminals" or attacker.team.name == "Civilian Workers") and exports.server:getPlayerChatZone(attacker) ~= "LV") then
- if ((source.team.name == "Criminals" or source.team.name == "Civilian Workers") and exports.server:getPlayerChatZone(source) ~= "LV") then
- cancelEvent()
- end
- end
- end
- end
- addEventHandler("onClientPlayerDamage", root, preventDM)
Advertisement
Add Comment
Please, Sign In to add comment