Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ENT.Type = "anim"
- ENT.Model = Model("models/valkyrie_camera/valkyrie_camera.mdl")
- AccessorFunc(ENT, "Placer", "Placer")
- AccessorFunc(ENT, "PlacedBy", "PlacedBy")
- function ENT:Initialize()
- if (IsValid(self)) then
- self:SetModel(self.Model)
- if SERVER then
- self:PhysicsInit(SOLID_VPHYSICS)
- self:SetMoveType(MOVETYPE_VPHYSICS)
- end
- self:SetSolid(SOLID_VPHYSICS)
- self:SetCollisionGroup(COLLISION_GROUP_WEAPON)
- if SERVER then
- self:SetUseType(SIMPLE_USE)
- self:SetMaxHealth(10)
- end
- self:SetHealth(10)
- self:Activate()
- end
- end
- function ENT:Use(activator)
- print("ENT:Use")
- print(activator)
- if IsValid(self) and IsValid(activator) and activator:IsPlayer() then
- local owner = self:GetPlacer()
- if owner == activator then
- if activator:HasWeapon("weapon_valkyrie_camera") then
- local weapon = activator:GetWeapon("weapon_valkyrie_camera")
- weapon:SetClip1(weapon:Clip1() + 1)
- else
- local weapon = activator:Give("weapon_valkyrie_camera")
- weapon:SetClip1(1)
- end
- if activator:HasWeapon("weapon_valkyrie_camera") then
- self:Remove()
- end
- end
- end
- end
- function ENT:Think()
- -- if thrower disconnects while the camera is active, remove it
- if SERVER and (not IsValid(self:GetPlacer())) then
- self:Remove()
- return
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment