Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Item = { Name, Descripton, Type, DisplayItem, Owner}
- ItemTypes =
- {
- Weapon = 0,
- Food = 1,
- Medical = 2,
- Ammo = 3,
- Clothing = 4,
- Attachment = 5,
- };
- if SERVER then
- function Item.Drop(ply)
- end
- function Item.Delete()
- end
- function Item.Spawn(X,Y)
- local ent = ents.Create("prop_physics")
- local ang = Vector(0,0,1):Angle();
- ang.pitch = ang.pitch + 90;
- ang:RotateAroundAxis(ang:Up(), math.random(0,360))
- ent:SetAngles(ang)
- ent:SetModel(Item.Path)
- local pos = Vector(X,Y,0)
- pos.z = pos.z - ent:OBBMaxs().z
- ent:SetPos( pos )
- ent:Spawn()
- end
- end
- function Item.New(name,descr,typ,ditem)
- Item.Name = name
- Item.Descripton = descr
- Item.Type = typ
- Item.DisplayItem = ditem
- return Item
- end
- function Item.SetUser(ply)
- Item.Owner = ply
- Item.DisplayItem.SetUser(ply)
- end
- if CLIENT then
- function Item.GetDisplayItem()
- return Item.DisplayItem
- end
- end
- function Item.IsWeapon()
- return Item.Type == ItemTypes.Weapon
- end
- function Item.IsFood()
- return Item.Type == ItemTypes.Food
- end
- function Item.IsMedical()
- return Item.Type == ItemTypes.Medical
- end
- function Item.IsAmmo()
- return Item.Type == ItemTypes.Ammo
- end
- function Item.IsClothing()
- return Item.Type == ItemTypes.Clothing
- end
- function Item.IsAttachment()
- return Item.Type == ItemTypes.Attachment
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement