Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 15th, 2010 | Syntax: Lua | Size: 1.44 KB | Hits: 32 | Expires: Never
Copy text to clipboard
  1.  
  2. -- This particular items table, must have it.
  3. local ITEM = { }
  4.  
  5. -- 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.
  6. ITEM.UniqueID = "dilettante"
  7.  
  8. -- The model that will be shown in the inventory and on the map.
  9. ITEM.Model = "models/sickness/dilettante.mdl"
  10.  
  11. -- The name for this item, used in the inventory menu.
  12. ITEM.Name = "Dilettante"
  13.  
  14. -- The description for this item, used in the inventory menu.
  15. ITEM.Description = "Class D hybrid vehicle"
  16.  
  17. -- The item price.
  18. ITEM.Price = "35000"
  19.  
  20. --Set it to true if its a car.
  21. ITEM.Car = true
  22.  
  23. -- Remove this item from the inventory when you press use on it?
  24. -- True will make it remove, false will make it stay.
  25. -- Use false for cars
  26. ITEM.RemoveOnUse = false
  27.  
  28. -- The USE item function.
  29. if ( SERVER ) then -- Only used on server so use this check.
  30.         function ITEM:USE( ply )
  31.         local map = string.lower(game.GetMap())
  32.         local ent = ents.Create("GTA4 Dilettante")  
  33.         ent:SetModel("models/sickness/dilettante.mdl")  --The model of the car.
  34.         ent:SetKeyValue("vehiclescript","sicknessmodel/scripts/vehicles/dilettante.txt")  -- the car script. If you dont know what you do, dont edit!
  35.         ent.Owner = ply
  36.         ent:Own(ply)
  37.         for k, v in pairs(CarSpawns) do
  38.                 if string.lower(k) == map then
  39.                         ent:SetPos(v)
  40.                 end
  41.         end
  42.         ent:Spawn()  
  43.         end
  44. end
  45.  
  46. -- Register the item so it exists in the main stuff.
  47. InventoryAddon:RegisterItem( ITEM )