Делюсь кодом со своего сервера. Код также отключает возможность разморозки предметов по нажатию R, а еще запрещает бросаться предметами с большой скоростью
local freeze_list = {
["prop_physics"] = true,
["gmod_button"] = true,
["lawboard"] = true,
}
local function freezeEnt(pl, ent)
if not IsValid(ent)
or not freeze_list[ent:GetClass()] then return end
ent:GetPhysicsObject():EnableMotion(false)
end
hook("PlayerSpawnedProp", "TPP", function(pl, _, ent) freezeEnt(pl, ent) end)
-- disable Physgun Reload mode
hook("OnPhysgunReload", "TPP.DisablePhysReloadMode", function(_,pl)
if not pl:IsSuperAdmin() then
return false
end
end)
local VEC = Vector(0,0,0)
hook("PhysgunDrop", "TPP", function(pl, ent) -- сброс скорости брошенного пропа
if IsValid(ent) and not ent:IsPlayer() then
local phys = ent:GetPhysicsObject()
if IsValid(phys) then
phys:AddAngleVelocity(phys:GetAngleVelocity() * -1)
phys:SetVelocityInstantaneous(VEC)
end
end
freezeEnt(pl,ent)
end)
P.S. Ссылка на пост появится в Telegram: Contact @gmodder