Initial commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
local function doScale(um)
|
||||
local ply = um:ReadEntity()
|
||||
local scale = um:ReadFloat()
|
||||
|
||||
if not IsValid(ply) then return end
|
||||
ply:SetModelScale(scale, 1)
|
||||
ply:SetHull(Vector(-16, -16, 0), Vector(16, 16, 72 * scale))
|
||||
end
|
||||
usermessage.Hook("darkrp_playerscale", doScale)
|
||||
@@ -0,0 +1,24 @@
|
||||
local minHull = Vector(-16, -16, 0)
|
||||
|
||||
local function setScale(ply, scale)
|
||||
ply:SetModelScale(scale, 0)
|
||||
|
||||
ply:SetHull(minHull, Vector(16, 16, 72 * scale))
|
||||
umsg.Start("darkrp_playerscale")
|
||||
umsg.Entity(ply)
|
||||
umsg.Float(scale)
|
||||
umsg.End()
|
||||
end
|
||||
|
||||
local function onLoadout(ply)
|
||||
local Team = ply:Team()
|
||||
if not RPExtraTeams[Team] or not tonumber(RPExtraTeams[Team].modelScale) then
|
||||
setScale(ply, 1)
|
||||
return
|
||||
end
|
||||
|
||||
local modelScale = tonumber(RPExtraTeams[Team].modelScale)
|
||||
|
||||
setScale(ply, modelScale)
|
||||
end
|
||||
hook.Add("PlayerLoadout", "playerScale", onLoadout)
|
||||
Reference in New Issue
Block a user