Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Put your Lua here
- -- CONFIG IS BELOW THIS --
- ----------------------------------------------------------------------
- local function AddVehicle(name, price, class, customcheck, cl_scale, base, tags)
- if type(name) == "string" then
- local veh = list.Get("Vehicles")[class]
- if veh == nil then
- table.insert(CAR_DISPLAY_CONFIG.FailedVehicles, {
- ["name"] = name,
- ["price"] = price,
- ["class"] = class,
- ["tags"] = tags,
- ["base"] = base,
- ["trace"] = debug.traceback()
- })
- return
- end
- local index = table.insert(CAR_DISPLAY_CONFIG.Vehicles, {
- ["name"] = name,
- ["price"] = price,
- ["model"] = veh.Model,
- ["script"] = veh.KeyValues.vehiclescript,
- ["class"] = class,
- ["basetype"] = base || "prop_vehicle_jeep",
- ["cl_scale"] = cl_scale || .9,
- ["customcheck"] = customcheck || function() return true end,
- ["allowed_bodygroups"] = {},
- ["allowed_colors"] = {},
- ["tags"] = tags,
- ["VehicleData"] = veh
- })
- CAR_DISPLAY_CONFIG.Vehicles[index]["index"] = index
- elseif type(name) == "table" then
- local tbl = name
- local veh = list.Get("Vehicles")[tbl.class]
- tbl.customcheck = tbl.customcheck || function() return true end
- if veh == nil then
- table.insert(CAR_DISPLAY_CONFIG.FailedVehicles, {
- ["name"] = tbl.name,
- ["price"] = tbl.price,
- ["class"] = tbl.class,
- ["tags"] = tbl.tags,
- ["base"] = tbl.base,
- ["trace"] = debug.traceback()
- })
- return
- end
- local index = table.insert(CAR_DISPLAY_CONFIG.Vehicles, {
- ["name"] = tbl.name,
- ["price"] = tbl.price,
- ["model"] = veh.Model,
- ["script"] = veh.KeyValues.vehiclescript,
- ["class"] = tbl.class,
- ["basetype"] = tbl.base || "prop_vehicle_jeep",
- ["cl_scale"] = tbl.cl_scale || .9,
- ["customfailmessage"] = tbl.customfailmessage || "You cannot purchase this vehicle!",
- ["customcheck"] = function(ply) return tbl.customcheck(ply), tbl.customfailmessage end,
- ["tags"] = tbl.tags,
- ["allowed_bodygroups"] = tbl.allowed_bodygroups || {},
- ["allowed_colors"] = tbl.allowed_colors || {},
- ["VehicleData"] = veh
- })
- CAR_DISPLAY_CONFIG.Vehicles[index]["index"] = index
- end
- end
- ----------------------------------------------------------------------
- -- Add your custom vehicles below as follows:
- -- <Display Name> : This shows up on all the screens when players are browsing cars
- -- <Price> : The price the player pays for the car
- -- <Vehicle Class> : Unique Identifier for the car, this is normally found in the vehicle script. If not you can just make it up HOWEVER READ THE BRACKETS (MAKE SURE THEIR UNIQUE THOUGH! ALSO THIS IS USED TO FIND THE SPAWNICON WITHOUT ITLL BE PURPLE AND BLACK SQUARES)
- -- <Custom Check> <Optional> : Custom wrote function that checks if the player is allowed to spawn the car in, returns two arguments <true/false> <message to display> true to allow the spawn, false to not allow the spawn. Message to show if the spawn was not allowed
- -- <Model Scale> <Optional> : Size of the model being displayed on the car pad
- -- <Base Entity> <Optional> : Entity used when creating the vehicle, this defaults to "prop_vehicle_jeep" (Afaik most vehicles use this) if yours uses a different set it here
- -- <Tags> <Optionals> : Tag the cars and it can be used to filter vehicles in game, cars of the same tag can be displayed together e.g. {"Muscle Car", "Sports", "Government"}
- -- <Allowed Bodygroups> <Optional> : Allowed Bodygroups that can be customised on the car
- -- <Allowed Colours> <Optional> : Allowed Colours that can be applied to the car
- -- Examples below
- --[[
- AddVehicle({
- name = "Jeep - HL2",
- price = 150000,
- class = "Jeep",
- customfailmessage = "You are not a donator!",
- customcheck = function(ply) return table.HasValue(ply:GetUserGroup(), {"VIP", "Donator"}),
- cl_scale = .2,
- base = "prop_vehicle_jeep",
- tags = {"Sports"},
- allowed_bodygroups = {
- ["wing"] = true
- },
- allowed_colors = {
- ["Emerald"] = true,
- ["Dark Blue"] = true,
- ["Wetasphalt"] = true,
- }
- })
- ]]--
- ----------------------------------------------------------------------
- function CarDisplay_LoadConfig()
- -- Example Vehicles, all default to gmod :)
- AddVehicle({
- name = "Jeep - HL2", -- Name shown on the Car Pad
- price = 150000, -- Price of the Car
- class = "Jep", -- Classname of the Car (Found in Q > Vehicles > Right Click > Copy to Clipboard)
- customfailmessage = "You are not a donator!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "Donator"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- cl_scale = .8, -- Scale of the vehicle on the pad (0 = smallest, 1 = largest)
- base = "prop_vehicle_jeep", -- Custom BaseTypes for different vehicle bases
- tags = {"Donator", "Sports"}, -- Tags used for filtering the Car Pads
- allowed_bodygroups = { -- If this is set only the shown bodygroups set to true can be modified
- ["wing"] = true
- },
- allowed_colors = { -- If this is set only the shown colours set to true can be used
- ["Emerald"] = true,
- ["Dark Blue"] = true,
- ["Wetasphalt"] = true,
- ["White"] = true,
- }
- })
- AddVehicle({
- name = "Dodge chrager 2015",
- price = 500000,
- class = "dodge_charger_2015_lw",
- })
- AddVehicle({
- name = "Jaguar xfr",
- price = 900000,
- class = "jag_xfr",
- })
- AddVehicle({
- name = "Audi R8",
- price = 1200000,
- class = "audir8tdm",
- })
- AddVehicle({
- name = "Audi R8 spyder",
- price = 1400000,
- class = "audir8spydtdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "Audi R8 Plus",
- price = 2000000,
- class = "audir8plustdm",
- })
- AddVehicle({
- name = "Audi RS4 Avant",
- price = 400000,
- class = "rs4avanttdm",
- })
- AddVehicle({
- name = "Audi S4",
- price = 350000,
- class = "auds4tdm",
- })
- AddVehicle({
- name = "Audi TT",
- price = 700000,
- class = "auditttdm",
- })
- AddVehicle({
- name = "BMW M1",
- price = 30000,
- class = "bmw1mtdm",
- })
- AddVehicle({
- name = "BMW 340ir",
- price = 100000,
- class = "bmw_340itdm",
- })
- AddVehicle({
- name = "BMW 507",
- price = 300000,
- class = "507tdm",
- })
- AddVehicle({
- name = "BMW M1 1981",
- price = 700000,
- class = "m1tdm",
- })
- AddVehicle({
- name = "BMW M3 E92",
- price =115000,
- class = "m3e92tdm",
- })
- AddVehicle({
- name = "BMW M3 GTR",
- price =150000,
- class = "bmwm3gtrtdm",
- })
- AddVehicle({
- name = "BMW M613",
- price = 70000,
- class = "bmwm613tdm",
- })
- AddVehicle({
- name = "Chevrolet Blazer",
- price = 16000,
- class = "che_blazertdm",
- })
- AddVehicle({
- name = "Camro SS",
- price = 100000,
- class = "che_69camarotdm",
- })
- AddVehicle({
- name = "Camro SS ZL1",
- price = 600000,
- class = "che_camarozl1tdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "Chevrolet chevelle ss",
- price = 40000,
- class = "che_chevellesstdm",
- })
- AddVehicle({
- name = "chevrolet corvette gsc",
- price = 150000,
- class = "che_corv_gsctdm",
- })
- AddVehicle({
- name = "chevrolet stingray",
- price = 300000,
- class = "che_stingray427tdm",
- })
- AddVehicle({
- name = "chevrolet Impala96",
- price = 10000,
- class = "che_impala96tdm",
- })
- AddVehicle({
- name = "Mazda RX-7",
- price = 120000,
- class = "rx7tdm",
- })
- AddVehicle({
- name = "Mazda RX-8",
- price = 85000,
- class = "rx8tdm",
- })
- AddVehicle({
- name = "Mazda Speed 3 2009",
- price = 75000,
- class = "speed3tdm",
- })
- AddVehicle({
- name = "Mazda MX 2005",
- price = 45000,
- class = "mx5tdm",
- })
- AddVehicle({
- name = "Ford F-150 Raptor",
- price = 160000,
- class = "17raptor_sgm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "Mazda Furai",
- price = 340000,
- class = "furaitdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "chevrolet Spark",
- price =5000,
- class = "che_sparktdm",
- })
- AddVehicle({
- name = "Dodge Challenger 70",
- price =70000,
- class = "challenger70tdm",
- })
- AddVehicle({
- name = "Dodge challenger 15",
- price = 100000,
- class = "dod_challenger15tdm",
- })
- AddVehicle({
- name = "Dodge chargers 8",
- price = 90000,
- class = "dodge_charger_2015_lw",
- })
- AddVehicle({
- name = "dodge ram1500",
- price = 500000,
- class = "dod_ram_1500tdm",
- })
- AddVehicle({
- name = "dodge ram ST",
- price = 600000,
- class = "dodgeramtdm",
- })
- AddVehicle({
- name = "F350 Superduty",
- price = 650000,
- class = "f350tdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- customCheck = function( ply ) return table.HasValue( {"VIP"}, ply:GetSecondaryUserGroup() ) end
- })
- AddVehicle({
- name = "ford shelby gt500",
- price = 600000,
- class = "for_she_gt500tdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "focus rs",
- price = 60000,
- class = "focusrstdm",
- })
- AddVehicle({
- name = "ford focus rs16",
- price = 70000,
- class = "for_focus_rs16tdm",
- })
- AddVehicle({
- name = "focus svt ",
- price = 40000,
- class = "focussvttdm",
- })
- AddVehicle({
- name = "Ford gt05",
- price = 600000,
- class = "gt05tdm",
- })
- AddVehicle({
- name = "mustanggttdm",
- price = 400000,
- class = "mustanggttdm",
- })
- AddVehicle({
- name = "Ford Raptor svt",
- price = 600000,
- class = "raptorsvttdm",
- })
- AddVehicle({
- name = "dodge ram ST",
- price = 600000,
- class = "dodgeramtdm",
- })
- AddVehicle({
- name = "Ford Transit",
- price = 4000,
- class = "transittdm",
- })
- AddVehicle({
- name = "civic 97",
- price = 10000,
- class = "civic97tdm",
- })
- AddVehicle({
- name = "honda crxsir",
- price = 20000,
- class = "hon_crxsirtdm",
- })
- AddVehicle({
- name = "Hoda 2000",
- price = 30000,
- class = "s2000tdm",
- })
- AddVehicle({
- name = "hudson hornet",
- price = 50000,
- class = "hudhornettdm",
- })
- AddVehicle({
- name = "Lamborghini gallardo",
- price = 1000000,
- class = "gallardotdm",
- })
- AddVehicle({
- name = "Lamborghini gallardo spyder",
- price = 1200000,
- class = "gallardospydtdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "Lamborghini miuracon",
- price = 1300000,
- class = "miuracontdm",
- })
- AddVehicle({
- name = "Lamborghini miura p400",
- price = 1400000,
- class = "miurap400tdm",
- })
- AddVehicle({
- name = "Lamborghini murcielago",
- price = 1500000,
- class = "murcielagotdm",
- })
- AddVehicle({
- name = "Lamborghini murcielagosv",
- price = 1000000,
- class = "murcielagosvtdm",
- })
- AddVehicle({
- name = "Lamborghini reventon Roadster",
- price = 1700000,
- class = "reventonrtdm",
- })
- AddVehicle({
- name = "Land rover Defender",
- price = 30000,
- class = "rlrdefendertdm",
- })
- AddVehicle({
- name = "land rover ",
- price = 40000,
- class = "landrovertdm",
- })
- AddVehicle({
- name = "land rover Super charged12",
- price = 50000,
- class = "landrover12tdm",
- })
- AddVehicle({
- name = "mercedes slr",
- price = 1000000,
- class = "mer_slrtdm",
- })
- AddVehicle({
- name = "mercedes 300 SEL",
- price = 170000,
- class = "mer300seltdm",
- })
- AddVehicle({
- name = "mercedes 300 SLGILL",
- price = 180000,
- class = "mer300slgulltdm",
- })
- AddVehicle({
- name = "mercedes C32 AMG",
- price = 200000,
- class = "c32amgtdm",
- })
- AddVehicle({
- name = "mercedes E63 AMG",
- price = 300000,
- class = "mere63tdm",
- })
- AddVehicle({
- name = "mercedes ML63",
- price = 150000,
- class = "merml63tdm",
- })
- AddVehicle({
- name = "Nissan GT-R Black Edition",
- price = 900000,
- class = "gtrtdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "Nissian Leaf",
- price = 14000,
- class = "nis_leaftdm",
- })
- AddVehicle({
- name = "Nissian siliva",
- price = 150000,
- class = "nissilvs15tdm",
- })
- AddVehicle({
- name = "Nissian Skyline",
- price = 400000,
- class = "r34tdm",
- })
- AddVehicle({
- name = "Porsche 911 GTR",
- price = 2000000,
- class = "porgt3rsrtdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "Porsche 918 Spyder",
- price = 1400000,
- class = "918spydtdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "Porsche 987 GT",
- price = 1200000,
- class = "997gt3tdm",
- })
- AddVehicle({
- name = "Porsche Carrera GT",
- price = 1000000,
- class = "carreragttdm",
- })
- AddVehicle({
- name = "Porsche Cayenne 12",
- price = 300000,
- class = "cayenne12tdm",
- })
- AddVehicle({
- name = "Porsche Cayenne Turbo",
- price = 400000,
- class = "cayennetdm",
- })
- AddVehicle({
- name = "Viper",
- price = 2000000,
- class = "vipvipertdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "Ferrari F50",
- price = 900000,
- class = "fer_f50tdm",
- })
- AddVehicle({
- name = "Ferrari 458 Spider",
- price = 2100000,
- class = "fer_458spidtdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "Ferrari F430",
- price = 1300000,
- class = "ferf430tdm",
- })
- AddVehicle({
- name = "Ferrari Enzo",
- price = 1800000,
- class = "fer_enzotdm",
- })
- AddVehicle({
- name = "Ferrari Berlinetta",
- price = 980000,
- class = "ferf12tdm",
- })
- AddVehicle({
- name = "Ferrari LaFerrari",
- price = 3000000,
- class = "fer_lafertdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "Ferrari 512 TR",
- price = 740000,
- class = "fer_512trtdm",
- })
- AddVehicle({
- name = "Ferrari 250 GT",
- price = 450000,
- class = "fer_250gttdm",
- })
- AddVehicle({
- name = "Ferrari 250 GTO",
- price = 340000,
- class = "fer_250gtotdm",
- })
- AddVehicle({
- name = "Bugatti EB110",
- price = 800000,
- class = "eb110tdm",
- })
- AddVehicle({
- name = "Aston Martin v12 Vantage",
- price = 1400000,
- class = "v12vantagetdm",
- customfailmessage = "This is a VIP car!", -- Message if the user cant buy the car
- customcheck = function(ply) return table.HasValue({"VIP", "superadmin"}, ply:GetUserGroup()) end, -- Custom Check function, works the same as DarkRP Jobs
- })
- AddVehicle({
- name = "Aston martin DB5",
- price = 450000,
- class = "ast_db5tdm",
- })
- -- USE THIS FOR TESTING ALL YOUR SERVERS CARS (May not function on some servers)
- --[[for k,v in pairs(list.Get("Vehicles")) do
- AddVehicle(v.Name, 1000, k, function() return true end, 1, v.Class)
- end--]]
- CAR_DISPLAY_CONFIG.HasLoaded = true
- end
- ------------------------------------------------------------------------
- CAR_DISPLAY_CONFIG.SellPercent = .2 -- Percent of the cars value that should be given back to the player when they sell it.
- CAR_DISPLAY_CONFIG.BuyPercent = .1 -- Percent of the cars original value should be charged when they want to change the colour or bodygroups
- CAR_DISPLAY_CONFIG.MaxSpawnedVehicles = 2 -- The max allowed vehicles a player is allowed out at any one time.
- ------------------------------------------------------------------------
- CAR_DISPLAY_CONFIG.CarColors = { // Default Car Colours
- ["Red"] = Color(255,0,0),
- ["White"] = Color(255,255,255),
- ["Blue"] = Color(0,0,255),
- ["Green"] = Color(0,255,0),
- ["Grey"] = Color(120,120,120),
- ["Black-Grey"] = Color(32,32,32),
- ["Black"] = Color(0,0,0),
- ["Yellow"] = Color(241,196,15),
- ["Light Blue"] = Color(52, 152, 219),
- ["Midnight Blue"] = Color(44, 62, 80),
- ["Azure"] = Color(240,255,255),
- ["Pink"] = Color(255,122,142),
- ["Cyan"] = Color(0,255,255),
- ["Dark Blue"] = Color(0,0,139),
- ["Forest Green"] = Color(34,139,34),
- ["Turquoise"] = Color(26,188,156),
- ["Emerald"] = Color(46,204,113),
- ["Jade Sea"] = Color(22,160,133),
- ["Nephritis"] = Color(39,174,96),
- ["Peter River"] = Color(52,152,219),
- ["Belizehole"] = Color(41,128,185),
- ["Amethyst"] = Color(155,89,182),
- ["Wisteria"] = Color(142,68,173),
- ["Wetasphalt"] = Color(52,73,94),
- ["Sunflower"] = Color(241,196,15),
- ["Carrot"] = Color(230,126,34),
- ["Orange"] = Color(243,156,18),
- ["Pumpkin"] = Color(211,84,0),
- ["Alizarin"] = Color(231,76,60),
- ["Pomegrnate"] = Color(192,57,43),
- ["Silver"] = Color(189,195,199),
- ["Asbestos"] = Color(127,140,141),
- ["Concrete"] = Color(149,165,166),
- ["Crimson"] = Color(189,8,28),
- ["Scarlet"] = Color(255,36,0),
- ["Gold"] = Color(255,215,0),
- ["Bronze"] = Color(205,127,50)
- }
- ---------------------------------------------------------------------
- if SERVER then
- AddCSLuaFile("lib/sh_language.lua")
- include("lib/sh_language.lua")
- else
- include("lib/sh_language.lua")
- end
- CAR_DISPLAY_CONFIG.Language = "EN" --built in languages (EN = English, FR = French, RU = Russian) Need some more translations to do a few more phrases for
- -- If you're interested in hepling out send me a message on SF or Steam, thanks
- ---------------------------------------------------------------------------
- --------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement