Untitled
By: a guest | Mar 15th, 2010 | Syntax:
Lua | Size: 1.44 KB | Hits: 32 | Expires: Never
-- This particular items table, must have it.
local ITEM = { }
-- The UniqueID for this item, this is used to spawn the item and it's the ID for the item. Text always has to be lowered.
ITEM.UniqueID = "dilettante"
-- The model that will be shown in the inventory and on the map.
ITEM.Model = "models/sickness/dilettante.mdl"
-- The name for this item, used in the inventory menu.
ITEM.Name = "Dilettante"
-- The description for this item, used in the inventory menu.
ITEM.Description = "Class D hybrid vehicle"
-- The item price.
ITEM.Price = "35000"
--Set it to true if its a car.
ITEM.Car = true
-- Remove this item from the inventory when you press use on it?
-- True will make it remove, false will make it stay.
-- Use false for cars
ITEM.RemoveOnUse = false
-- The USE item function.
if ( SERVER ) then -- Only used on server so use this check.
function ITEM:USE( ply )
local map = string.lower(game.GetMap())
local ent = ents.Create("GTA4 Dilettante")
ent:SetModel("models/sickness/dilettante.mdl") --The model of the car.
ent:SetKeyValue("vehiclescript","sicknessmodel/scripts/vehicles/dilettante.txt") -- the car script. If you dont know what you do, dont edit!
ent.Owner = ply
ent:Own(ply)
for k, v in pairs(CarSpawns) do
if string.lower(k) == map then
ent:SetPos(v)
end
end
ent:Spawn()
end
end
-- Register the item so it exists in the main stuff.
InventoryAddon:RegisterItem( ITEM )