Защита от урона по своим

Позволяет убрать урон по профессиям

local mply = FindMetaTable("Player")



function mply:IsCP()

    local tabl = self:getJobTable()

    return tabl.category == "Правительство"

end 



function mply:IsML()

    local tabl = self:getJobTable()

    return tabl.category == "Военные"

end 





if not (SERVER) then

    return

end





hook.Add("EntityTakeDamage","NoTeamDamage",function (ply,dmg)

	if not (ply:IsPlayer()) then return end

	if not (dmg:GetAttacker():IsPlayer()) then return end

	local att = dmg:GetAttacker()

	if(att:GetNWBool("IsParticipant") or ply:GetNWBool("IsParticipant")) then

        return

    end

	if(ply:IsCP() and att:IsCP() and att~=ply) then

		att:SendLua('chat.AddText(Color(155,0,0), "[DamageProtect]", Color(255,255,255), " Вы не можете нанести урон другому полицейскому!")')

		dmg:SetDamage(0)

	end

	if(ply:IsML() and att:IsML() and att~=ply) then

		att:SendLua('chat.AddText(Color(155,0,0), "[DamageProtect]", Color(255,255,255), " Вы не можете нанести урон другому военному!")')

		dmg:SetDamage(0)

	end

end)

supernoteamdamage.zip (1,2 КБ)

Изменять по категориям! :
image

Добавить предупреждающие надпись:

Результат:

можно было сделать по проверке GAMEMODE.CivilProtection[v:Team()] , ну и ладно