mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
51
lua/entities/pill_attachment_wep.lua
Normal file
51
lua/entities/pill_attachment_wep.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
AddCSLuaFile()
|
||||
ENT.Type = "anim"
|
||||
ENT.AutomaticFrameAdvance = true
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar("Vector", 0, "WepOffset")
|
||||
self:NetworkVar("Angle", 0, "WepAng")
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
if self.attachment then
|
||||
self:Fire("setparentattachment", "anim_attachment_RH", 0)
|
||||
else
|
||||
self:AddEffects(bit.bor(EF_BONEMERGE, EF_BONEMERGE_FASTCULL))
|
||||
end
|
||||
|
||||
self:SetRenderMode(RENDERMODE_TRANSALPHA)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
self:NextThink(CurTime())
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
local offset = self:GetWepOffset()
|
||||
local ang = self:GetWepAng()
|
||||
|
||||
if offset ~= Vector(0, 0, 0) then
|
||||
self:SetRenderOrigin(self:LocalToWorld(offset))
|
||||
end
|
||||
|
||||
if ang ~= Angle(0, 0, 0) then
|
||||
self:SetRenderAngles(self:LocalToWorldAngles(ang))
|
||||
end
|
||||
|
||||
self:DrawModel()
|
||||
end
|
||||
Reference in New Issue
Block a user