AddCSLuaFile()
ENT.Type = "anim"
ENT.Base = "base_entity"
ENT.PrintName = "Money Giver"
ENT.Author = "Your Name"
ENT.Category = "Your Addon"
ENT.Spawnable = true
ENT.Model = "models/props/cs_assault/money.mdl" -- Модель для энтити
ENT.Size = Vector(1, 1, 1) -- Размеры энтити
ENT.MoneyAmount = 100 -- Сумма денег, которую выдаем игроку
function ENT:Initialize()
self:SetModel(self.Model)
self:SetSolid(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
local phys = self:GetPhysicsObject()
if IsValid(phys) then
phys:Wake()
end
end
function ENT:Use(activator, caller)
if IsValid(caller) and caller:IsPlayer() then
if not self.Used then
self.Used = true
caller:addMoney(self.MoneyAmount)
end
end
end