• No collide m9k deagles in armoury?
    2 replies, posted
Hi, I'm developing my own server and was wondering how to no collide weapons in the armoury, specifically New Summer V2 deagle place thing (Idk xD). The deagles collide so much that it lags the server, its not the number of entities either since the second you take out all the deagles the server works great. (don't know if it matters but i am using Jailbreak 7) Thank you so much in advance.
You can disable collision on all map created weapons with: [code]hook.Add("InitPostEntity", "DisableWeaponCollision", function() local tEntities = ents.GetAll() for i = 1, #tEntities do local pEntity = tEntities[i] if (pEntity:IsWeapon() and pEntity:MapCreationID() ~= -1) then pEntity:SetCollisionGroup(COLLISION_GROUP_DEBRIS_TRIGGER) end end end)[/code] If you only want to limit it to the armoury, you'll have to check if the weapon is located in a pre-defined armoury area with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Vector/WithinAABox]Vector:WithinAABox[/url]. If you want it to apply to all created weapons, you can use a [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/OnEntityCreated]GM:OnEntityCreated[/url] hook, instead.
[QUOTE=code_gs;52873303]You can disable collision on all map created weapons with: [code]hook.Add("InitPostEntity", "DisableWeaponCollision", function() local tEntities = ents.GetAll() for i = 1, #tEntities do local pEntity = tEntities[i] if (pEntity:IsWeapon() and pEntity:MapCreationID() ~= -1) then pEntity:SetCollisionGroup(COLLISION_GROUP_DEBRIS_TRIGGER) end end end)[/code] If you only want to limit it to the armoury, you'll have to check if the weapon is located in a pre-defined armoury area with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Vector/WithinAABox]Vector:WithinAABox[/url]. If you want it to apply to all created weapons, you can use a [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/OnEntityCreated]GM:OnEntityCreated[/url] hook, instead.[/QUOTE] oh ok, i think it'd be fine to all weapons, is this is serverside or...? [editline]9th November 2017[/editline] [QUOTE=BraveNM22;52873647]oh ok, i think it'd be fine to all weapons, is this is serverside or...?[/QUOTE] nvm, put it in serverside and it works, thanks so much !!!
Sorry, you need to Log In to post a reply to this thread.