mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
43
gamemodes/helix/plugins/entityscaling/sh_plugin.lua
Normal file
43
gamemodes/helix/plugins/entityscaling/sh_plugin.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
PLUGIN.name = "Entity Scaling"
|
||||
PLUGIN.description = "A simple plugin providing scaling functionality on entities."
|
||||
PLUGIN.author = "Mango"
|
||||
|
||||
ix.scalestuff = ix.scalestuff or {}
|
||||
|
||||
PLUGIN.disallowedClasses = {
|
||||
"prop_ragdoll"
|
||||
}
|
||||
|
||||
CAMI.RegisterPrivilege({
|
||||
Name = "Helix - Entity Scaling",
|
||||
MinAccess = "admin"
|
||||
})
|
||||
|
||||
ix.command.Add("entscale", {
|
||||
description = "Scale an entity to a desired size.",
|
||||
adminOnly = true,
|
||||
arguments = {
|
||||
ix.type.number
|
||||
},
|
||||
OnRun = function(self, client, val)
|
||||
if !CAMI.PlayerHasAccess(client, "Helix - Entity Scaling", nil) then return end
|
||||
|
||||
local ent = client:GetEyeTraceNoCursor().Entity
|
||||
|
||||
ix.scalestuff:ScaleEntity(ent, val)
|
||||
end
|
||||
})
|
||||
|
||||
ix.util.Include("sv_plugin.lua")
|
||||
29
gamemodes/helix/plugins/entityscaling/sv_plugin.lua
Normal file
29
gamemodes/helix/plugins/entityscaling/sv_plugin.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
function ix.scalestuff:ScaleEntity(ent, size)
|
||||
if (IsValid(ent) and !ent:IsNPC() and !ent:IsPlayer() and isnumber(size)) then
|
||||
for _, v in ipairs(PLUGIN.disallowedClasses) do
|
||||
if (ent:GetClass() == v) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
ent:SetModelScale(size, 0.01)
|
||||
ent:DrawShadow(false)
|
||||
ent:Activate()
|
||||
ent:SetSolid(SOLID_BBOX)
|
||||
ent:SetMoveType(MOVETYPE_NONE)
|
||||
|
||||
ent.scaledSize = size
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user