DarkNessProvides

Williams car dealer tdm cars done

Nov 12th, 2015
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.28 KB | None | 0 0
  1. // This file is for cars only!
  2. /*
  3.                 if you need any help you are welcome to add me:
  4.                 http://steamcommunity.com/id/Busan1
  5.  
  6.     Format:
  7.     CarDealer.Cars[ "entityname" ] = {
  8.         requiresBuy = true/false,
  9.         restricted = { name = "Government", jobs = { TEAM_POLICE } },
  10.         price = 25000,
  11.         disallowPaint = false,
  12.         disallowSkin = false,
  13.         disallowBodygroups = false,
  14.         defaultSkin = 1,
  15.         fuel = 100,
  16.         fuelLoss = 5000,
  17.         dealerid = 1,
  18.         name = "NAME IS NOT REQUIRED"
  19.     }
  20.    
  21.     requiresBuy: this has to be set, always!
  22.     false is good for  donator/police cars
  23.     false means that it's 100% free to spawn
  24.     it doesn't save in the database
  25.     so if it at some point changes to true,
  26.     then players need to buy it.
  27.    
  28.     restricted: this doesn't have to be set
  29.     if it is, then you can use:
  30.     jobs = { TEAM_POLICE, TEAM_SWAT  etc },
  31.     AND, OR:
  32.     ranks = { "donator", "vipdonator" }
  33.     If you want to restrict to police + donator, that means:
  34.     restricted = { name = "VIP or Police", jobs = { TEAM_POLICE }, ranks = { "donator" }, needboth = false }
  35.     if you want to restrict to VIP OR police, or VIP AND police,
  36.     use needboth.
  37.     needboth = true = must be donator + police
  38.     needboth = false = must be donator OR police
  39.    
  40.     price = 25000, how much does it cost?
  41.     ^ should be set always ^
  42.    
  43.     disallowPaint = can the car be painted?(good for police cars)
  44.     ^ not required to be set, defaults to false ^
  45.    
  46.     disallowSkin  = can the car skin be changed?(good for police cars)
  47.     ^ not required to be set, defaults to false ^
  48.    
  49.     disallowBodygroups = can you change bodygroups?(good for police cars)
  50.     ^ not required to be set, defaults to false ^
  51.    
  52.     defaultSkin = set a default skin(good for police cars)
  53.     ^ not required to be set, defaults to false ^
  54.    
  55.     fuel = how many litres of fuel is in the car?
  56.     ^ doesn't have to be set, it will default to wcd_settings.lua^
  57.    
  58.     fuelLoss = 5000 - if a car should lose  more or less fuel.
  59.     ^ doesn't have to be set, it defaults to whatever is set in wcd_settings.lua(line 65)
  60.     default value: 3500
  61.    
  62.     dealerid = 5
  63.     ^ does not have to be set ^
  64.     defaults to 0
  65.     if you set to something else than 0, all dealers with this id will deal the cars
  66.     useful to make a Police car dealer etc.
  67.     It can  also look like:
  68.     dealerid = { 1, 2, 3 } if multiple car dealers sell this car!
  69.    
  70.     name = "anything"
  71.     This will overwrite the default name(taken from Q menu)
  72.    
  73.     not set means that you don't need it!
  74.     A car can look this easy:
  75.     CarDealer.Cars[ "camarozl1tdm" ] = {
  76.         requiresBuy = true,
  77.         price = 50000
  78.     }
  79.    
  80. */
  81.  
  82. // THESE ARE  JUST SOME EXAMPLE CARS!
  83. // If you dont have these cars on the server
  84. // You will be unable to open the car dealer menu
  85. // Please read the description above on how to add your own cars
  86. function InitializeSharedCarDealer()
  87.  
  88.     if( !CarDealer ) then
  89.         return;
  90.     end
  91.  
  92.     // PLEASE READ THE TEXT ABOVE TO UNDERSTAND HOW TO ADD A CAR.
  93.     // YOU CAN GENERATE ALL TDM CARS BY TYPING IN YOUR SERVER/WEB CONSOLE:
  94.     // lua_run GenerateAllMyCarsPlease()
  95.     // THEN GO TO garrysmod/data/GENERATEDCARS.txt
  96.     // COPY EVERYTHING AND PASTE BELOW.
  97.     // THEN SET PRICES and add any of the config things you find above.
  98.    
  99.    
  100.    
  101.         CarDealer.Cars[ "300ctdm"] = {
  102.         requiresBuy = true,
  103.         price = 100000,
  104.         name = "BMW"
  105.     }
  106.  
  107.  
  108.     CarDealer.Cars[ "bmw1mtdm"] = {
  109.         requiresBuy = true,
  110.         price = 10000
  111.     }
  112.  
  113.  
  114.     CarDealer.Cars[ "audir8plustdm"] = {
  115.         requiresBuy = true,
  116.         price = 100000,
  117.         name = "Audi R8"
  118.     }
  119.  
  120.  
  121.     CarDealer.Cars[ "coupe40tdm"] = {
  122.         requiresBuy = true,
  123.         price = 2500000
  124.     }
  125.  
  126.  
  127.     CarDealer.Cars[ "mitsu_evoxtdm"] = {
  128.         requiresBuy = true,
  129.         price = 10000,
  130.         restricted = { name = "Government Only", jobs = { TEAM_POLICE, TEAM_SCHIEF, TEAM_SWAT, TEAM_SWATSNIPER, TEAM_PCHIEF } }
  131.     }
  132.  
  133.  
  134.     CarDealer.Cars[ "che_camarozl1tdm"] = {
  135.         requiresBuy = true,
  136.         price = 5000000
  137.     }
  138.  
  139.  
  140.     CarDealer.Cars[ "gt05tdm"] = {
  141.         requiresBuy = true,
  142.         price = 10000000
  143.     }
  144.  
  145.  
  146.     CarDealer.Cars[ "audir8spydtdm"] = {
  147.         requiresBuy = true,
  148.         price = 500000
  149.     }
  150.  
  151.  
  152.     CarDealer.Cars[ "coopers11tdm"] = {
  153.         requiresBuy = true,
  154.         price = 10000
  155.     }
  156.  
  157.  
  158.     CarDealer.Cars[ "chr300c12tdm"] = {
  159.         requiresBuy = true,
  160.         price = 1000000
  161.     }
  162.  
  163.  
  164.     CarDealer.Cars[ "vipvipertdm"] = {
  165.         requiresBuy = true,
  166.         price = 2500000
  167.     }
  168.  
  169.  
  170.     CarDealer.Cars[ "transittdm"] = {
  171.         requiresBuy = true,
  172.         price = 100000
  173.     }
  174.  
  175.  
  176.     CarDealer.Cars[ "xbowtdm"] = {
  177.         requiresBuy = true,
  178.         price = 2500000
  179.     }
  180.  
  181.  
  182.     CarDealer.Cars[ "dodgeramtdm"] = {
  183.         requiresBuy = true,
  184.         price = 5000000
  185.     }
  186.  
  187.  
  188.     CarDealer.Cars[ "cooper65tdm"] = {
  189.         requiresBuy = true,
  190.         price = 20000
  191.     }
  192.  
  193.  
  194.     CarDealer.Cars[ "chargersrt8tdm"] = {
  195.         requiresBuy = true,
  196.         price = 7500000
  197.     }
  198.  
  199.  
  200.     CarDealer.Cars[ "veyronsstdm"] = {
  201.         requiresBuy = true,
  202.         price = 100000000
  203.     }
  204.  
  205.  
  206.     CarDealer.Cars[ "gallardospydtdm"] = {
  207.         requiresBuy = true,
  208.         price = 10000000
  209.     }
  210.  
  211.  
  212.     CarDealer.Cars[ "bowlexrstdm"] = {
  213.         requiresBuy = true,
  214.         price = 100000
  215.     }
  216.  
  217.    
  218.    
  219.    
  220.    
  221.      
  222.    
  223.    
  224.     // Editing done!
  225.     CarDealer.MaxFuelFromModel = {};
  226.     for i, v in pairs( list.Get( "Vehicles" ) ) do
  227.         if( CarDealer.Cars[ i ] && v.Model ) then
  228.             v.Model  = string.lower( v.Model );
  229.             CarDealer.MaxFuelFromModel[ v.Model ] = CarDealer.Cars[ i ].fuel or CarDealer.Settings.DefaultFuel;
  230.             util.PrecacheModel( v.Model );
  231.         end
  232.     end
  233.  
  234. end
  235.  
  236. InitializeSharedCarDealer();
Advertisement
Add Comment
Please, Sign In to add comment