So I own a darkrp server and this map I use has a lot of annoying props that spawn. Is there any way to remove these props from the map? Ive seen other servers do it but have no idea how to do it, Can someone show me how to do this? thanks!
You might wanna search over the board
[QUOTE][url]https://facepunch.com/showthread.php?t=1371884[/url][/QUOTE]
So ive used this:
local blacklist = {
["prop_physics"] = true,
["prop_whatever"] = true,
}
hook.Add( "InitPostEntity", "wat", function()
for _, ent in pairs( ents.GetAll() ) do
if blacklist[ ent:GetClass() ] then ent:Remove() end
end
end )
it cleared a lot of props on the map but theres still a microwave, any idea how to remove everything?
There are many prop types, prop_dynamic, prop_detail, prop_static, check out the full list on the valve wiki and add the appropriate one to your blacklist
So uh i revised my little code here i saw on facepunch to this:
local blacklist = {
["prop_physics"] = true,
["prop_detail"] = true,
["prop_static"] = true,
["prop_dynamic"] = true,
["prop_ragdoll"] = true,
["prop_whatever"] = true,
}
hook.Add( "InitPostEntity", "wat", function()
for _, ent in pairs( ents.GetAll() ) do
if blacklist[ ent:GetClass() ] then ent:Remove() end
end
end )
and uh, the darn microwave still is there
Try this:
Go up to the microwave and look directly at it so the middle of your screen is on the microwave, then run this clientside using lua_run_cl or whatever:
[CODE]
local trace = LocalPlayer():GetEyeTrace()
local ent = trace.Entity
print(ent:GetClass())
[/CODE]
That should give you the entity's class so you can add it to the list...unless it's an actual part of the map or something
[editline]14th February 2016[/editline]
If that doesn't actually return an entity, try doing
[CODE]
PrintTable( trace )
[/CODE]
There are some keys in that table that can tell you if it's part of the world or not
im confused, where do i enter this info?
[QUOTE=JoeyJohn;49735763]im confused, where do i enter this info?[/QUOTE]
You could just do it in the console- type
[CODE]
sv_allowcslua 1
[/CODE]
And then type
[CODE]lua_run_cl print(LocalPlayer():GetEyeTrace().Entity:GetClass())[/CODE]
It's just a thing you could do for debugging-you don't need to put it in a file somewhere or anything
this did the trick! no more pesky microwave! thanks! <3
Sorry, you need to Log In to post a reply to this thread.