Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hook.Add( "Initialize", "CS_CONFIG_Initialize_Hook", function()
- // MAIN CONFIG
- -- Main
- CreditShop_Config.UseDarkRP = true -- Whether or not you are using DarkRP.
- CreditShop_Config.UseWorkshop = true -- True uses WorkShop (ID: 1378473140), false uses FastDL (Remember to sync it).
- -- Themes
- CreditShop_Config.Theme = "Blur" -- Options: "Blur", "Flat" can be used with the skin.
- -- Menu Configs
- CreditShop_Config.ShopName = "CREDIT STORE" -- The name of the shop, e.g. "CREDIT STORE"
- CreditShop_Config.ShopName3DEffect = true -- Whether or not the shop title should have a 3D effect
- CreditShop_Config.ShopUseCommand = true -- Whether or not the shop can be opened through a command (command can be changed below)
- CreditShop_Config.ShopCommand = "/creditstore" -- The command used to open the shop
- CreditShop_Config.ShopOpenWith = "F3" -- Can the shop be opened by a key Options: ( "NONE" = can't be opened using a key, "F1", "F2", "F3", "F4" )
- CreditShop_Config.ExchangeName = "CREDIT EXCHANGE" -- The name of the exchange, e.g. "CREDIT EXCHANGE"
- CreditShop_Config.ExchangeName3DEffect = true -- Whether or not the exchange title should have a 3D effect
- -- SQL
- CreditShop_Config.UseSQL = false -- Whether or not an SQL should be used (recommended true if you have a database)
- CreditShop_Config.CSDATABASE_HOST = "HOST" -- The host of the SQL database ( an IP ).
- CreditShop_Config.CSDATABASE_USERNAME = "USERNAME" -- The username for the SQL database.
- CreditShop_Config.CSDATABASE_PASSWORD = "PASSWORD" -- The password for the SQL database.
- CreditShop_Config.CSDATABASE_DATABASENAME = "DATABASENAME" -- The databasename of the SQL database.
- CreditShop_Config.CSDATABASE_DATABASEPORT = 3306 -- The DatabasePort, normally 3306.
- --Paydays and Credit System
- CreditShop_Config.STARTCREDITS = 5 -- This is the amount of credits that players start with.
- CreditShop_Config.ENABLE_SIMPLE_HUD = true -- Whether or not the simple HUD should be enabled - only draws credits
- CreditShop_Config.PAYDAYS = true -- Whether or not paydays should occur
- CreditShop_Config.PAYDAY_AMOUNT = 1000 -- How much credits a person should be given every PAYDAY_INTERVALS.
- CreditShop_Config.PAYDAY_INTERVALS = 120 -- In seconds, how often should the player receive the PAYDAY_AMOUNT.
- CreditShop_Config.CdDrpRate = 100 -- The amount of darkrp currency you get from 1 credit, and therefore how many dollars it takes to get 1 credit.
- CreditShop_Config.SaveStatsTime = 10 -- How often a player's credit stats should be saved.
- --PAGES--
- CreditShop_ExtraPages[1] = {
- Name = "Donate",
- Website = "https://www.gmodstore.com/scripts/view/4663",
- Icon = "icon16/coins.png"
- }
- CreditShop_ExtraPages[2] = {
- Name = "Wiki",
- Website = "http://wiki.garrysmod.com/page/Main_Page",
- Icon = "icon16/computer.png"
- }
- CreditShop_ExtraPages[3] = {
- Name = "Colors",
- Website = "https://www.w3schools.com/colors/colors_rgb.asp",
- Icon = "icon16/color_wheel.png"
- }
- // ADD ITEM CONFIG
- local ItemSort = "High_Low" -- Options: "High_Low", "Low_High", "Random"
- --[[--
- CreditShop_Items["health"] = { -- Unique name
- Name = "200 Health", -- Name shown in shop
- Description = "Gives you 200 HP. (Maximum 200 HP allowed)", -- The description shown in the shop
- InDepthDescription = "Sets your player model until your next death/job change!", -- A description shown in the about menu
- Model = "models/props_junk/GlassBottle01a.mdl", -- The model of the product
- Price = 1, -- the price of the product
- PM = false, -- whether the product is a player model or not, do not set this to true aswell as icon
- Icon = true, -- whether you want to use an icon or not
- IconImg = "materials/dark_matter/health.png", -- if Icon = true, then what image shoud it use
- OnPurFunction = -- the function to be called when a player buys it!
- function(ply,item)
- local HealthToGive = 200
- local MaxHealth = 200
- if ply:Health() + HealthToGive < MaxHealth then
- ply:SetHealth(ply:Health() + HealthToGive)
- else
- ply:SetHealth(MaxHealth)
- end
- end,
- }
- --]]--
- -- Playermodel example
- CreditShop_Items["skeleton"] = {
- Name = "Skeleton PM",
- Description = "Sets your player model until your next death/job change!",
- InDepthDescription = "Sets your player model until your next death/job change!",
- Model = "models/player/skeleton.mdl",
- Price = 2,
- PM = true,
- Icon = false,
- OnPurFunction =
- function(ply,item)
- ply:SetModel("models/player/skeleton.mdl")
- end,
- }
- -- Icon (HP) example
- CreditShop_Items["health"] = {
- Name = "200 Health",
- Description = "Gives you 200 HP. (Maximum 200 HP allowed)",
- InDepthDescription = "Gives you 200 HP. (Maximum 200 HP allowed)",
- Model = "models/props_junk/GlassBottle01a.mdl",
- Price = 1,
- PM = false,
- Icon = true,
- IconImg = "materials/credit_shop/health.png",
- OnPurFunction =
- function(ply,item)
- local HealthToGive = 200
- local MaxHealth = 200
- if ply:Health() + HealthToGive < MaxHealth then
- ply:SetHealth(ply:Health() + HealthToGive)
- else
- ply:SetHealth(MaxHealth)
- end
- end,
- }
- -- Icon (AP) example
- CreditShop_Items["armor"] = {
- Name = "200 Armor",
- Description = "Gives you 200 armor. (Maximum 200 armor allowed)",
- InDepthDescription = "Gives you 200 armor. (Maximum 200 armor allowed)",
- Model = "models/props_junk/garbage_plasticbottle003a.mdl",
- Price = 2,
- PM = false,
- Icon = true,
- IconImg = "materials/credit_shop/armor.png",
- OnPurFunction =
- function(ply,item)
- local ArmorToGive = 200
- local MaxArmor = 200
- if ply:Health() + ArmorToGive < MaxArmor then
- ply:SetArmor(ply:Health() + ArmorToGive)
- else
- ply:SetArmor(MaxArmor)
- end
- end,
- }
- -- Icon (Weapon) example
- CreditShop_Items["minigun"] = {
- Name = "Minigun",
- Description = "Gives you a minigun!",
- InDepthDescription = "Gives you a minigun!",
- Model = "models/weapons/w_m134_minigun.mdl",
- Price = 10,
- PM = false,
- Icon = false,
- OnPurFunction =
- function(ply,item)
- ply:Give( "m9k_minigun" )
- end,
- }
- -- Permanent weapon example2
- CreditShop_Items["perm_shotgun"] = {
- Name = "Perm Shotgun",
- Description = "Gives you a Permanent Shotgun!",
- InDepthDescription = "Gives you a Permanent Shotgun!",
- Model = "models/weapons/w_shotgun.mdl",
- PermClass = "weapon_shotgun",
- PermWep = true,
- Price = 50,
- PM = false,
- Icon = false,
- OnPurFunction =
- function(ply,item)
- ply:Give( "weapon_shotgun" )
- ply:CS_AddPermWep( "weapon_shotgun" )
- end,
- }
- CreditShop_Items["perm_smg"] = {
- Name = "Perm SMG",
- Description = "Gives you a SMG Shotgun!",
- InDepthDescription = "Gives you a SMG Shotgun!",
- Model = "models/weapons/w_smg1.mdl",
- PermClass = "weapon_smg1",
- PermWep = true,
- Price = 35,
- PM = false,
- Icon = false,
- OnPurFunction =
- function(ply,item)
- ply:Give( "weapon_smg1" )
- ply:CS_AddPermWep( "weapon_smg1" )
- end,
- }
- -- Vehicle example
- CreditShop_Items["jeep"] = {
- Name = "Jeep",
- Description = "Gives you a Jeep!",
- InDepthDescription = "Gives you a Jeep!",
- Model = "models/buggy.mdl",
- Price = 15,
- PM = true,
- Icon = false,
- OnPurFunction =
- function(ply,item)
- local car = ents.Create("prop_vehicle_jeep_old")
- car:SetModel("models/buggy.mdl")
- car:SetKeyValue("vehiclescript","scripts/vehicles/jeep_test.txt")
- car:SetPos(ply:GetPos()-Vector( 0, 100, 0 ) )
- car:Spawn()
- end,
- }
- -- User group example
- CreditShop_Items["vip"] = {
- Name = "VIP Rank",
- Description = "Gives you the VIP rank!",
- InDepthDescription = "Gives you the VIP rank!",
- Model = "models/buggy.mdl",
- Price = 1500,
- PM = false,
- Icon = true,
- IconImg = "icon16/shield.png",
- OnPurFunction =
- function(ply,item)
- ply:SetUserGroup( "admin" )
- end,
- }
- if( CreditShop_Config.UseDarkRP == true ) then
- -- Icon (Money) examples
- CreditShop_Items["dollars"] = {
- Name = "$75,000",
- Description = "Gives you $75,000",
- InDepthDescription = "Gives you $75,000",
- Model = "models/props/cs_assault/money.mdl",
- Price = 750,
- PM = false,
- Icon = false,
- IconImg = "materials/dark_matter/minigun.png",
- OnPurFunction =
- function(ply,item)
- ply:addMoney(75000)
- end,
- }
- CreditShop_Items["dollars2"] = {
- Name = "$250,000",
- Description = "Gives you $250,000",
- InDepthDescription = "Gives you $250,000",
- Model = "models/props/cs_assault/money.mdl",
- Price = 2500,
- PM = false,
- Icon = false,
- IconImg = "materials/dark_matter/minigun.png",
- OnPurFunction =
- function(ply,item)
- ply:addMoney(250000)
- end,
- }
- CreditShop_Items["dollars3"] = {
- Name = "$1,000,000",
- Description = "Gives you $1,000,000",
- InDepthDescription = "Gives you $1,000,000",
- Model = "models/props/cs_assault/money.mdl",
- Price = 100000,
- PM = false,
- Icon = false,
- IconImg = "materials/dark_matter/minigun.png",
- OnPurFunction =
- function(ply,item)
- ply:addMoney(1000000)
- end,
- }
- end
- if( ItemSort == "High_Low" ) then
- table.sort(CreditShop_Items, function(a, b) return a.Price > b.Price end);
- elseif( ItemSort == "Low_High" ) then
- table.sort(CreditShop_Items, function(a, b) return a.Price < b.Price end);
- end
- // PRESET CONFIG
- --PRESETS--
- --[[--
- CreditShop_Presets[1] = {
- Name = "Tropical Preset", --Preset Name
- TextColor = Color(120,120,120,255), --Preset Text color
- ThemeColor = Color(0,238,255,150) --Preset Theme color
- }
- CreditShop_Presets[5] = {
- Name = "Rainbow Preset", --Preset Name
- Flash = true, --Should the preset constantly change colors
- TextColor = Color(255,255,255,255), --Preset Text Color
- minRed = 0, -- Minimum Red
- maxRed = 255, -- Maximum Red
- minGreen = 0, -- Minimum Green
- maxGreen = 255, -- Maximum Green
- minBlue = 0, -- Minimum Blue
- maxBlue = 255, -- Maximum Blue
- Alpha = 200 -- Alpha ( opacity )
- }
- --]]--
- CreditShop_Presets = {} --IGNORE
- CreditShop_Presets[1] = {
- Name = "Red Preset",
- TextColor = Color(255,174,174,255),
- ThemeColor = Color(255,0,0,150)
- }
- CreditShop_Presets[2] = {
- Name = "Orange Preset",
- TextColor = Color(255,234,174,255),
- ThemeColor = Color(255,144,0,175)
- }
- CreditShop_Presets[3] = {
- Name = "Yellow Preset",
- TextColor = Color(255,255,196,255),
- ThemeColor = Color(255,255,0,184)
- }
- CreditShop_Presets[4] = {
- Name = "Green Preset",
- TextColor = Color(211,255,210,255),
- ThemeColor = Color(12,255,0,200)
- }
- CreditShop_Presets[5] = {
- Name = "Light Blue Preset",
- TextColor = Color(255,255,255,255),
- ThemeColor = Color(0,255,242,200)
- }
- CreditShop_Presets[6] = {
- Name = "Blue Preset",
- TextColor = Color(142,142,255,255),
- ThemeColor = Color(0,4,255,200)
- }
- CreditShop_Presets[7] = {
- Name = "Pink Preset",
- TextColor = Color(251,160,255,255),
- ThemeColor = Color(255,0,238,200)
- }
- CreditShop_Presets[8] = {
- Name = "Purple Preset",
- TextColor = Color(178,0,157,236),
- ThemeColor = Color(126,0,161,236)
- }
- CreditShop_Presets[9] = {
- Name = "Sun Preset",
- TextColor = Color(255,0,0,255),
- ThemeColor = Color(198,66,0,150)
- }
- CreditShop_Presets[10] = {
- Name = "Dark Preset",
- TextColor = Color(255,255,255,255),
- ThemeColor = Color(0,0,0,255)
- }
- CreditShop_Presets[11] = {
- Name = "Tropical Preset",
- TextColor = Color(120,120,120,255),
- ThemeColor = Color(0,238,255,150)
- }
- CreditShop_Presets[12] = {
- Name = "Rainbow Preset",
- Flash = true,
- TextColor = Color(255,255,255,255),
- minRed = 0,
- maxRed = 255,
- minGreen = 0,
- maxGreen = 255,
- minBlue = 0,
- maxBlue = 255,
- Alpha = 200
- }
- CreditShop_Presets[13] = {
- Name = "Red Mayhem Preset",
- Flash = true,
- TextColor = Color(255,255,255,255),
- minRed = 0,
- maxRed = 255,
- minGreen = 0,
- maxGreen = 0,
- minBlue = 0,
- maxBlue = 0,
- Alpha = 200
- }
- CreditShop_Presets[14] = {
- Name = "Green Mayhem Preset",
- Flash = true,
- TextColor = Color(255,255,255,255),
- minRed = 0,
- maxRed = 0,
- minGreen = 0,
- maxGreen = 255,
- minBlue = 0,
- maxBlue = 0,
- Alpha = 200
- }
- CreditShop_Presets[15] = {
- Name = "Blue Mayhem Preset",
- Flash = true,
- TextColor = Color(255,255,255,255),
- minRed = 0,
- maxRed = 0,
- minGreen = 0,
- maxGreen = 0,
- minBlue = 0,
- maxBlue = 255,
- Alpha = 200
- }
- CreditShop_Presets[16] = {
- Name = "White Mayhem Preset",
- Flash = true,
- TextColor = Color(255,255,255,255),
- minRed = 200,
- maxRed = 255,
- minGreen = 200,
- maxGreen = 255,
- minBlue = 200,
- maxBlue = 255,
- Alpha = 200
- }
- //IGNORE
- function formatCredits( num ) -- Formats a number like this "10,000 Credits", saves space
- return string.Comma(num).." Credits"
- end
- end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement