Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[-------------------------------------------------------------------------
- Actual code to freeze props.
- ---------------------------------------------------------------------------]]
- local function fucktheprops(ply,ent)
- if ent:GetClass() == "prop_physics" then
- local phys = ent:GetPhysicsObject()
- if (IsValid(phys)) then
- phys:EnableMotion(false)
- end
- end
- end
- hook.Add("PhysgunDrop", "phys", fucktheprops)
- --[[-------------------------------------------------------------------------
- Timer otherwise it wont freeze on spawn properly.
- ---------------------------------------------------------------------------]]
- local function timerprops()
- timer.Simple(0.1, fucktheprops)
- end
- --[[-------------------------------------------------------------------------
- Collide the meth system recipes.
- ---------------------------------------------------------------------------]]
- local function ShouldNotCollide_hr_cm( ent1, ent2 )
- if string.match(ent1:GetClass(),"hr_cm_") != nil or string.match(ent2:GetClass(),"hr_cm_") != nil then
- if ent1:GetClass() == "player" or ent2:GetClass() == "player" then return true end
- if ent1:GetClass() == "worldspawn" or ent2:GetClass() == "worldspawn" then return true end
- if ent1:GetClass() == "hr_cm_stove" or ent2:GetClass() == "hr_cm_stove" then return true end
- return false
- end
- return true
- end
- hook.Add( "ShouldCollide", "ShouldNotCollide_hr_cm", ShouldNotCollide_hr_cm )
- local function MarkNew_hr_cm()
- for k,v in pairs(ents.FindByClass( "hr_cm_*")) do
- v:SetCustomCollisionCheck( true )
- end
- end
- hook.Add( "Tick", "CheckForNew_hr_cm",MarkNew_hr_cm)
- --[[-------------------------------------------------------------------------
- Hooks.
- ---------------------------------------------------------------------------]]
- hook.Add("PlayerSpawnProp","FUCKTHEPROPSMAN", timerprops)
- hook.Add("PhysgunDrop", "phys", fucktheprops)
- --[[-------------------------------------------------------------------------
- Adv dupe exploit.
- ---------------------------------------------------------------------------]]
- hook.Add("PlayerSpawnedProp", "removeBlackListedModel", function(ply, model, ent)
- if (tostring(ent:GetPhysicsObject()) == "[NULL PhysObject]") then
- ent:Remove()
- end
- end)
- hook.Add("OnEntityCreated", "deleteThePieceOfShitAdvDupeEntity", function(ent)
- if(ent:GetClass() == "gmod_contr_spawner")then ent:Remove()
- elseif(ent:GetClass() == "keypad" or ent:GetClass() == "gmod_button" or string.find(ent:GetClass(), "wire_") != nil or ent:GetClass() == "gmod_cameraprop*")then
- timer.Simple(0.01, function()
- local tempstring = tostring(ent:CPPIGetOwner())
- if(tempstring == "nil")then
- ent:Remove()
- elseif(tostring(ent:GetPhysicsObject()) == "[NULL PhysObject]")then
- ent:Remove()
- end
- end)
- end
- if(ent:GetClass() == "gmod_wire_keyboard")then
- for k, v in pairs(player.GetAll())do
- if(v:IsSuperAdmin())then
- timer.Simple(0, function()
- v:PrintMessage(HUD_PRINTTALK, "Ent physobj: "..tostring(ent:GetPhysicsObject()))
- end)
- end
- end
- end
- end)
- --[[-------------------------------------------------------------------------
- materials on car restrict.
- ---------------------------------------------------------------------------]]
- hook.Add("CanTool","RestrictCarMaterialer",function( ply, tr, tool )
- if tool == "material" and IsValid( tr.Entity ) and tr.Entity:GetClass() == "prop_vehicle_jeep" then
- return false
- end
- end)
- --[[-------------------------------------------------------------------------
- Button exploit fix.
- ---------------------------------------------------------------------------]]
- local buttonList = {
- "models/maxofs2d/button_01.mdl",
- "models/maxofs2d/button_02.mdl",
- "models/maxofs2d/button_03.mdl",
- "models/maxofs2d/button_04.mdl",
- "models/maxofs2d/button_05.mdl",
- "models/maxofs2d/button_06.mdl",
- "models/maxofs2d/button_slider.mdl"
- }
- hook.Add("CanTool", "ToolExploitFix", function(ply, tr, tool)
- if tool == "button" then
- local model = ply:GetInfo( "button_model" )
- if not table.HasValue( buttonList, model ) then
- ply:ConCommand( "button_model models/maxofs2d/button_05.mdl" )
- ply:ConCommand( "button_model" )
- return false
- end
- end
- end)
- --[[-------------------------------------------------------------------------
- Ip write warner.
- ---------------------------------------------------------------------------]]
- local ipwarns = {}
- hook.Add("PlayerSay", "preventIpsInChat", function( ply, text )
- if(!ply:IsSuperAdmin())then
- if(string.match( text, "%d+%.%d+%.%d+%.%d+") != nil)then
- local foundIP = string.match( text, "%d+%.%d+%.%d+%.%d+")
- --add to warnings
- if(ipwarns[ply:SteamID()] == nil)then
- ipwarns[ply:SteamID()] = 1
- else
- ipwarns[ply:SteamID()] = ipwarns[ply:SteamID()] + 1
- end
- --Warn player
- ply:PrintMessage(HUD_PRINTTALK, "Do not type IP addresses in chat, you now have "..ipwarns[ply:SteamID()].." warnings, if you reach 3, you will be kicked.")
- --Tell admins
- for k, v in pairs(player.GetAll())do
- if(v:GetUserGroup() == "superadmin" or v:GetUserGroup() == "Head Admin" or v:GetUserGroup() == "Community Leader" or v:GetUserGroup() == "admin")then
- v:PrintMessage(HUD_PRINTTALK, ply:Nick().." tried typing IP: "..foundIP)
- v:PrintMessage(HUD_PRINTTALK, "Original message: "..text)
- v:PrintMessage(HUD_PRINTTALK, "Warnings given: "..ipwarns[ply:SteamID()])
- end
- end
- --kick if too many ips
- if(ipwarns[ply:SteamID()] >= 3)then
- if(!ply:IsSuperAdmin())then
- ipwarns[ply:SteamID()] = nil
- for k, v in pairs(player.GetAll())do
- v:PrintMessage(HUD_PRINTTALK, ply:Nick().." was kicked. Reason: typing IP addresses in chat after 3 warnings.")
- end
- ply:Kick("Posting IP addresses in chat after 3 warnings.")
- end
- end
- return ""
- end
- end
- end)
- --[[-------------------------------------------------------------------------
- physgun r disable.
- ---------------------------------------------------------------------------]]
- hook.Add("OnPhysgunReload","physgunrcancrashservers",function(wep,ply)
- if not ply:IsSuperAdmin() then return false
- end
- end)
- --[[-------------------------------------------------------------------------
- player blackscreen prop exploit fix.
- ---------------------------------------------------------------------------]]
- function SpawnedProp(ply, model, ent)
- if string.lower(ent:GetMaterial()) == "pp/copy" then
- ent:Remove()
- end
- end
- hook.Add("PlayerSpawnedProp", "playerSpawnedProp", SpawnedProp)
- function MatCheck(pl, trace, toolmode)
- if toolmode:lower() == "material" then
- local tool = pl:GetActiveWeapon():GetToolObject()
- if string.lower(tool:GetClientInfo("override")) == "pp/copy" then
- return false
- end
- end
- end
- hook.Add("CanTool", "MatCheck", MatCheck)
- --[[-------------------------------------------------------------------------
- staff prop spam warn.
- ---------------------------------------------------------------------------]]
- hook.Add("PlayerSpawnedProp","printif10sameprop",function(ply,mdl)
- if not ply.TenIdenticalPropLog then ply.TenIdenticalPropLog = {lastprop = "", count = 0} end
- if ply.TenIdenticalPropLog.lastprop ~= mdl then
- ply.TenIdenticalPropLog.lastprop = mdl
- ply.TenIdenticalPropLog.count = 1
- else
- ply.TenIdenticalPropLog.count = ply.TenIdenticalPropLog.count + 1
- end
- if ply.TenIdenticalPropLog.count == 10 then
- for k,v in pairs(player.GetAll()) do
- if v:IsAdmin() then
- v:ChatPrint(ply:GetName().." has spawned the same prop ("..mdl..") 10 times, he might be crashing the server.")
- end
- end
- ply.TenIdenticalPropLog.count = 1
- end
- end)
- --[[-------------------------------------------------------------------------
- remove car and prop damage to players.
- ---------------------------------------------------------------------------]]
- local function NoCDMOrCrush( ply, dmginfo )
- if dmginfo:GetAttacker():IsVehicle() or (dmginfo:GetAttacker():IsPlayer() and dmginfo:GetAttacker():InVehicle()) then dmginfo:SetDamage(0) end
- if dmginfo:IsDamageType(DMG_CRUSH) then dmginfo:SetDamage(0) end
- return dmginfo
- end
- hook.Add( "EntityTakeDamage", "StoppingCDM", NoCDMOrCrush )
- --[[-------------------------------------------------------------------------
- Delete props that fall out of map.
- ---------------------------------------------------------------------------]]
- local Ent = FindMetaTable("Entity")
- local Phys = FindMetaTable("PhysObj")
- if(Ent.SetRealPos == nil)then
- Ent.SetRealPos = Ent.SetPos
- end
- if(Phys.SetRealPos == nil)then
- Phys.SetRealPos = Phys.SetPos
- end
- local clamp = math.Clamp
- function Ent.SetPos(ent, pos)
- pos.x = clamp(pos.x, -500000, 500000)
- pos.y = clamp(pos.y, -500000, 500000)
- pos.z = clamp(pos.z, -500000, 500000)
- Ent.SetRealPos(ent, pos)
- end
- function Phys.SetPos(phys, pos)
- pos.x = clamp(pos.x, -500000, 500000)
- pos.y = clamp(pos.y, -500000, 500000)
- pos.z = clamp(pos.z, -500000, 500000)
- Phys.SetRealPos(phys, pos)
- end
- --[[-------------------------------------------------------------------------
- No collides props with eachother.
- ---------------------------------------------------------------------------]]
- if SERVER then AddCSLuaFile() end
- hook.Add( "OnEntityCreated", "prop_customcollisions", function( ent ) if ent:GetClass() == "prop_physics" then ent:SetCustomCollisionCheck( true ) end end )
- hook.Add( "ShouldCollide", "prop_nocollide", function( ent1, ent2 ) if ent1:GetClass() == "prop_physics" and ent2:GetClass() == "prop_physics" then return false end end )
- --[[-------------------------------------------------------------------------
- Decal remover timer.
- ---------------------------------------------------------------------------]]
- timer.Create("cleardecals", 300,0, function() RunConsoleCommand("r_cleardecals") end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement