daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Nov 5th, 2018 110 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. hook.Add( "Initialize", "CS_CONFIG_Initialize_Hook", function()
  2. // MAIN CONFIG
  3.  
  4.     -- Main
  5.     CreditShop_Config.UseDarkRP = true -- Whether or not you are using DarkRP.
  6.     CreditShop_Config.UseWorkshop = true -- True uses WorkShop (ID: 1378473140), false uses FastDL (Remember to sync it).
  7.  
  8.     -- Themes
  9.     CreditShop_Config.Theme = "Blur" -- Options: "Blur", "Flat" can be used with the skin.
  10.  
  11.     -- Menu Configs
  12.     CreditShop_Config.ShopName = "CREDIT STORE" -- The name of the shop, e.g. "CREDIT STORE"
  13.     CreditShop_Config.ShopName3DEffect = true -- Whether or not the shop title should have a 3D effect
  14.     CreditShop_Config.ShopUseCommand = true -- Whether or not the shop can be opened through a command (command can be changed below)
  15.     CreditShop_Config.ShopCommand = "/shp" -- The command used to open the shop
  16.     CreditShop_Config.ShopOpenWith = "F6" -- Can the shop be opened by a key Options: ( "NONE" = can't be opened using a key, "F1", "F2", "F3", "F4" )
  17.    
  18.     CreditShop_Config.ExchangeName = "CREDIT EXCHANGE" -- The name of the exchange, e.g. "CREDIT EXCHANGE"
  19.     CreditShop_Config.ExchangeName3DEffect = true -- Whether or not the exchange title should have a 3D effect
  20.  
  21.     -- SQL
  22.     CreditShop_Config.UseSQL = false -- Whether or not an SQL should be used (recommended true if you have a database)
  23.     CreditShop_Config.CSDATABASE_HOST = "HOST" -- The host of the SQL database ( an IP ).
  24.     CreditShop_Config.CSDATABASE_USERNAME = "USERNAME" -- The username for the SQL database.
  25.     CreditShop_Config.CSDATABASE_PASSWORD = "PASSWORD" -- The password for the SQL database.
  26.     CreditShop_Config.CSDATABASE_DATABASENAME = "DATABASENAME" -- The databasename of the SQL database.
  27.     CreditShop_Config.CSDATABASE_DATABASEPORT = 3306 -- The DatabasePort, normally 3306.
  28.  
  29.     --Paydays and Credit System
  30.     CreditShop_Config.STARTCREDITS = 0 -- This is the amount of credits that players start with.
  31.     CreditShop_Config.ENABLE_SIMPLE_HUD = true -- Whether or not the simple HUD should be enabled - only draws credits
  32.     CreditShop_Config.PAYDAYS = true -- Whether or not paydays should occur
  33.     CreditShop_Config.PAYDAY_AMOUNT = 1 -- How much credits a person should be given every PAYDAY_INTERVALS.
  34.     CreditShop_Config.PAYDAY_INTERVALS = 3600 -- In seconds, how often should the player receive the PAYDAY_AMOUNT.
  35.  
  36.     CreditShop_Config.CdDrpRate = 10000 -- The amount of darkrp currency you get from 1 credit, and therefore how many dollars it takes to get 1 credit.
  37.    
  38.     CreditShop_Config.SaveStatsTime = 10 -- How often a player's credit stats should be saved.
  39.  
  40.     --PAGES--
  41.  
  42.     CreditShop_ExtraPages[1] = {
  43.         Name = "Donate",
  44.         Website = "https://paypal.me/melvindjackson",
  45.         Icon = "icon16/coins.png"
  46.     }
  47.  
  48.    
  49.    
  50.    
  51. // ADD ITEM CONFIG
  52.     local ItemSort = "High_Low" -- Options: "High_Low", "Low_High", "Random"
  53.     --[[--
  54.     CreditShop_Items["health"] = { -- Unique name
  55.         Name = "200 Health", -- Name shown in shop
  56.         Description = "Gives you 200 HP. (Maximum 200 HP allowed)", -- The description shown in the shop
  57.         InDepthDescription = "Sets your player model until your next death/job change!", -- A description shown in the about menu
  58.         Model = "models/props_junk/GlassBottle01a.mdl", -- The model of the product
  59.         Price = 1, -- the price of the product
  60.         PM = false, -- whether the product is a player model or not, do not set this to true aswell as icon
  61.         Icon = true, -- whether you want to use an icon or not
  62.         IconImg = "materials/dark_matter/health.png", -- if Icon = true, then what image shoud it use
  63.         OnPurFunction = -- the function to be called when a player buys it!
  64.             function(ply,item)
  65.                 local HealthToGive = 200
  66.                 local MaxHealth = 200
  67.                
  68.                 if ply:Health() + HealthToGive < MaxHealth then
  69.                     ply:SetHealth(ply:Health() + HealthToGive)
  70.                 else
  71.                     ply:SetHealth(MaxHealth)
  72.                 end  
  73.             end,
  74.     }
  75.     --]]--
  76.  
  77.     -- Playermodel example
  78.     CreditShop_Items["skeleton"] = {
  79.         Name = "Skeleton PM",
  80.         Description = "Sets your player model until your next death/job change!",
  81.         InDepthDescription = "Sets your player model until your next death/job change!",
  82.         Model = "models/player/skeleton.mdl",
  83.         Price = 1,
  84.         PM = true,
  85.         Icon = false,
  86.         OnPurFunction =
  87.             function(ply,item)
  88.                 ply:SetModel("models/player/skeleton.mdl")
  89.             end,
  90.     }
  91.  
  92.     -- Icon (HP) example
  93.     --CreditShop_Items["health"] = {
  94.         --Name = "200 Health",
  95.         --Description = "Gives you 200 HP. (Maximum 200 HP allowed)",
  96.         --InDepthDescription = "Gives you 200 HP. (Maximum 200 HP allowed)",
  97.         --Model = "models/props_junk/GlassBottle01a.mdl",
  98.         --Price = 1,
  99.         --PM = false,
  100.         --Icon = true,
  101.         --IconImg = "materials/credit_shop/health.png",
  102.         --OnPurFunction =
  103.             --function(ply,item)
  104.                 --local HealthToGive = 200
  105.                 --local MaxHealth = 200
  106.                
  107.                 --if ply:Health() + HealthToGive < MaxHealth then
  108.                     --ply:SetHealth(ply:Health() + HealthToGive)
  109.                 --else
  110.                     --ply:SetHealth(MaxHealth)
  111.                 --end  
  112.             --end,
  113.     }
  114.  
  115.     -- Icon (AP) example
  116.  
  117.  
  118.     -- Icon (Weapon) example
  119.  
  120.     -- Permanent weapon example2
  121.     CreditShop_Items["perm_stungun"] = {
  122.         Name = "Perm Stun Gun",
  123.         Description = "Gives you a Permanent Stun Gun",
  124.         InDepthDescription = "",
  125.         Model = "models/weapons/w_shotgun.mdl",
  126.         PermClass = "stungun",
  127.         PermWep = true,
  128.         Price = 50000,
  129.         PM = false,
  130.         Icon = false,
  131.         OnPurFunction =
  132.             function(ply,item)
  133.                 ply:Give( "stungun" )
  134.                 ply:CS_AddPermWep( "stungun" )
  135.             end,
  136.     }
  137.    
  138.     CreditShop_Items["perm_crowbar"] = {
  139.         Name = "Perm SMG",
  140.         Description = "Gives you a SMG Shotgun!",
  141.         InDepthDescription = "Gives you a SMG Shotgun!",
  142.         Model = "models/weapons/w_smg1.mdl",
  143.         PermClass = "weapon_crowbar",
  144.         PermWep = true,
  145.         Price = ,
  146.         PM = false,
  147.         Icon = false,
  148.         OnPurFunction =
  149.             function(ply,item)
  150.                 ply:Give( "weapon_crowbar" )
  151.                 ply:CS_AddPermWep( "weapon_crowbar" )
  152.             end,
  153.     }
  154.    
  155.     -- Vehicle example
  156.     --CreditShop_Items["jeep"] = {
  157.         --Name = "Jeep",
  158.         --Description = "Gives you a Jeep!",
  159.         --InDepthDescription = "Gives you a Jeep!",
  160.         --Model = "models/buggy.mdl",
  161.         --Price = 15,
  162.         --PM = true,
  163.         --Icon = false,
  164.         --OnPurFunction =
  165.             --function(ply,item)
  166.                 --local car = ents.Create("prop_vehicle_jeep_old")
  167.                 --car:SetModel("models/buggy.mdl")
  168.                 --car:SetKeyValue("vehiclescript","scripts/vehicles/jeep_test.txt")
  169.                 --car:SetPos(ply:GetPos()-Vector( 0, 100, 0 ) )
  170.                 --car:Spawn()
  171.             --end,
  172.     --}
  173.    
  174.     -- User group example
  175.     CreditShop_Items["vip"] = {
  176.         Name = "VIP Rank",
  177.         Description = "Gives you the VIP rank!",
  178.         InDepthDescription = "Gives you the VIP rank!",
  179.         Model = "models/buggy.mdl",
  180.         Price = 1000,
  181.         PM = false,
  182.         Icon = true,
  183.         IconImg = "icon16/shield.png",
  184.         OnPurFunction =
  185.             function(ply,item)
  186.                 ply:SetUserGroup( "vip" )
  187.             end,
  188.     }
  189.  
  190.     if( CreditShop_Config.UseDarkRP == true ) then
  191.         -- Icon (Money) examples
  192.         CreditShop_Items["dollars"] = {
  193.             Name = "$10,000",
  194.             Description = "Gives you $10,000",
  195.             InDepthDescription = "Gives you $10,000",
  196.             Model = "models/props/cs_assault/money.mdl",
  197.             Price = 1,
  198.             PM = false,
  199.             Icon = false,
  200.             IconImg = "materials/dark_matter/minigun.png",
  201.             OnPurFunction =
  202.                 function(ply,item)
  203.                     ply:addMoney(10000)
  204.                 end,
  205.         }
  206.  
  207.         CreditShop_Items["dollars2"] = {
  208.             Name = "$50,000",
  209.             Description = "Gives you $50,000",
  210.             InDepthDescription = "Gives you $50,000",
  211.             Model = "models/props/cs_assault/money.mdl",
  212.             Price = 5,
  213.             PM = false,
  214.             Icon = false,
  215.             IconImg = "materials/dark_matter/minigun.png",
  216.             OnPurFunction =
  217.                 function(ply,item)
  218.                     ply:addMoney(50000)
  219.                 end,
  220.         }
  221.  
  222.  
  223.     end
  224.        
  225.     if( ItemSort == "High_Low" ) then
  226.         table.sort(CreditShop_Items, function(a, b) return a.Price > b.Price end);
  227.     elseif( ItemSort == "Low_High" ) then
  228.         table.sort(CreditShop_Items, function(a, b) return a.Price < b.Price end);
  229.     end
  230.    
  231. // PRESET CONFIG
  232.  
  233.     --PRESETS--
  234.  
  235.     --[[--
  236.     CreditShop_Presets[1] = {
  237.         Name = "Tropical Preset", --Preset Name
  238.         TextColor = Color(120,120,120,255), --Preset Text color
  239.         ThemeColor = Color(0,238,255,150) --Preset Theme color
  240.     }
  241.  
  242.     CreditShop_Presets[5] = {
  243.         Name = "Rainbow Preset", --Preset Name
  244.         Flash = true, --Should the preset constantly change colors
  245.         TextColor = Color(255,255,255,255), --Preset Text Color
  246.         minRed = 0, -- Minimum Red
  247.         maxRed = 255, -- Maximum Red
  248.         minGreen = 0, -- Minimum Green
  249.         maxGreen = 255, -- Maximum Green
  250.         minBlue = 0, -- Minimum Blue
  251.         maxBlue = 255, -- Maximum Blue
  252.         Alpha = 200 -- Alpha ( opacity )
  253.     }
  254.     --]]--
  255.  
  256.  
  257.     CreditShop_Presets = {} --IGNORE
  258.  
  259.     CreditShop_Presets[1] = {
  260.         Name = "Red Preset",
  261.         TextColor = Color(255,174,174,255),
  262.         ThemeColor = Color(255,0,0,150)
  263.     }
  264.  
  265.     CreditShop_Presets[2] = {
  266.         Name = "Orange Preset",
  267.         TextColor = Color(255,234,174,255),
  268.         ThemeColor = Color(255,144,0,175)
  269.     }
  270.  
  271.     CreditShop_Presets[3] = {
  272.         Name = "Yellow Preset",
  273.         TextColor = Color(255,255,196,255),
  274.         ThemeColor = Color(255,255,0,184)
  275.     }
  276.  
  277.     CreditShop_Presets[4] = {
  278.         Name = "Green Preset",
  279.         TextColor = Color(211,255,210,255),
  280.         ThemeColor = Color(12,255,0,200)
  281.     }
  282.  
  283.     CreditShop_Presets[5] = {
  284.         Name = "Light Blue Preset",
  285.         TextColor = Color(255,255,255,255),
  286.         ThemeColor = Color(0,255,242,200)
  287.     }
  288.  
  289.     CreditShop_Presets[6] = {
  290.         Name = "Blue Preset",
  291.         TextColor = Color(142,142,255,255),
  292.         ThemeColor = Color(0,4,255,200)
  293.     }
  294.  
  295.     CreditShop_Presets[7] = {
  296.         Name = "Pink Preset",
  297.         TextColor = Color(251,160,255,255),
  298.         ThemeColor = Color(255,0,238,200)
  299.     }
  300.  
  301.     CreditShop_Presets[8] = {
  302.         Name = "Purple Preset",
  303.         TextColor = Color(178,0,157,236),
  304.         ThemeColor = Color(126,0,161,236)
  305.     }
  306.  
  307.     CreditShop_Presets[9] = {
  308.         Name = "Sun Preset",
  309.         TextColor = Color(255,0,0,255),
  310.         ThemeColor = Color(198,66,0,150)
  311.     }
  312.  
  313.     CreditShop_Presets[10] = {
  314.         Name = "Dark Preset",
  315.         TextColor = Color(255,255,255,255),
  316.         ThemeColor = Color(0,0,0,255)
  317.     }
  318.  
  319.     CreditShop_Presets[11] = {
  320.         Name = "Tropical Preset",
  321.         TextColor = Color(120,120,120,255),
  322.         ThemeColor = Color(0,238,255,150)
  323.     }
  324.  
  325.     CreditShop_Presets[12] = {
  326.         Name = "Rainbow Preset",
  327.         Flash = true,
  328.         TextColor = Color(255,255,255,255),
  329.         minRed = 0,
  330.         maxRed = 255,
  331.         minGreen = 0,
  332.         maxGreen = 255,
  333.         minBlue = 0,
  334.         maxBlue = 255,
  335.         Alpha = 200
  336.     }
  337.  
  338.    
  339.     //IGNORE
  340.     function formatCredits( num ) -- Formats a number like this "10,000 Credits", saves space
  341.         return string.Comma(num).." Credits"
  342.     end
  343.    
  344. end )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top