Advertisement
Guest User

Untitled

a guest
May 12th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.88 KB | None | 0 0
  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 = "Flat" -- Options: "Blur", "Flat" can be used with the skin.
  10.  
  11. -- Text Above NPCs Config
  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.ExchangeName = "CREDIT EXCHANGE" -- The name of the exchange, e.g. "CREDIT EXCHANGE"
  15. CreditShop_Config.ExchangeName3DEffect = true -- Whether or not the exchange title should have a 3D effect
  16.  
  17. -- SQL
  18. CreditShop_Config.UseSQL = false -- Whether or not an SQL should be used (recommended true if you have a database)
  19. CreditShop_Config.CSDATABASE_HOST = "digitaldeltagaming.net" -- The host of the SQL database ( an IP ).
  20. CreditShop_Config.CSDATABASE_USERNAME = "ddgdarkrp" -- The username for the SQL database.
  21. CreditShop_Config.CSDATABASE_PASSWORD = "cu7NBNc><=^%z%rR" -- The password for the SQL database.
  22. CreditShop_Config.CSDATABASE_DATABASENAME = "ddgdarkrp_creditshop" -- The databasename of the SQL database.
  23. CreditShop_Config.CSDATABASE_DATABASEPORT = 3306 -- The DatabasePort, normally 3306.
  24.  
  25. --Paydays and Credit System
  26. CreditShop_Config.STARTCREDITS = 50 -- This is the amount of credits that players start with.
  27. CreditShop_Config.ENABLE_SIMPLE_HUD = false -- Whether or not the simple HUD should be enabled - only draws credits
  28. CreditShop_Config.PAYDAYS = true -- Whether or not paydays should occur
  29. CreditShop_Config.PAYDAY_AMOUNT = 1000 -- How much credits a person should be given every PAYDAY_INTERVALS.
  30. CreditShop_Config.PAYDAY_INTERVALS = 120 -- In seconds, how often should the player receive the PAYDAY_AMOUNT.
  31.  
  32. 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.
  33.  
  34. CreditShop_Config.SaveStatsTime = 10 -- How often a player's credit stats should be saved.
  35.  
  36. --PAGES--
  37.  
  38. CreditShop_ExtraPages[1] = {
  39. Name = "Donate",
  40. Website = "https://digitaldeltagaming.net/store/",
  41. Icon = "icon16/coins.png"
  42. }
  43.  
  44. CreditShop_ExtraPages[2] = {
  45. Name = "Wiki",
  46. Website = "http://wiki.garrysmod.com/page/Main_Page",
  47. Icon = "icon16/computer.png"
  48. }
  49.  
  50. CreditShop_ExtraPages[3] = {
  51. Name = "Colors",
  52. Website = "https://www.w3schools.com/colors/colors_rgb.asp",
  53. Icon = "icon16/color_wheel.png"
  54. }
  55.  
  56.  
  57. // ADD ITEM CONFIG
  58. local ItemSort = "High_Low" -- Options: "High_Low", "Low_High", "Random"
  59. --[[--
  60. CreditShop_Items["health"] = { -- Unique name
  61. Name = "200 Health", -- Name shown in shop
  62. Description = "Gives you 200 HP. (Maximum 200 HP allowed)", -- The description shown in the shop
  63. InDepthDescription = "Sets your player model until your next death/job change!", -- A description shown in the about menu
  64. Model = "models/props_junk/GlassBottle01a.mdl", -- The model of the product
  65. Price = 1, -- the price of the product
  66. PM = false, -- whether the product is a player model or not, do not set this to true aswell as icon
  67. Icon = true, -- whether you want to use an icon or not
  68. IconImg = "materials/dark_matter/health.png", -- if Icon = true, then what image shoud it use
  69. OnPurFunction = -- the function to be called when a player buys it!
  70. function(ply,item)
  71. local HealthToGive = 200
  72. local MaxHealth = 200
  73.  
  74. if ply:Health() + HealthToGive < MaxHealth then
  75. ply:SetHealth(ply:Health() + HealthToGive)
  76. else
  77. ply:SetHealth(MaxHealth)
  78. end
  79. end,
  80. }
  81. --]]--
  82.  
  83. -- Playermodel example
  84. CreditShop_Items["agent"] = {
  85. Name = "Barney PM",
  86. Description = "Sets your player model until your next death/job change!",
  87. InDepthDescription = "Sets your player model until your next death/job change!",
  88. Model = "models/player/skeleton.mdl",
  89. Price = 50,
  90. PM = true,
  91. Icon = false,
  92. OnPurFunction =
  93. function(ply,item)
  94. ply:SetModel("models/player/barney.mdl")
  95. end,
  96. }
  97.  
  98. -- Icon (HP) example
  99. CreditShop_Items["health"] = {
  100. Name = "120 Health",
  101. Description = "Gives you 120 HP.",
  102. InDepthDescription = "Gives you 120 HP.",
  103. Model = "models/props_junk/GlassBottle01a.mdl",
  104. Price = 1000,
  105. PM = false,
  106. Icon = true,
  107. IconImg = "materials/credit_shop/health.png",
  108. OnPurFunction =
  109. function(ply,item)
  110. local HealthToGive = 120
  111. local MaxHealth = 120
  112.  
  113. if ply:Health() + HealthToGive < MaxHealth then
  114. ply:SetHealth(ply:Health() + HealthToGive)
  115. else
  116. ply:SetHealth(MaxHealth)
  117. end
  118. end,
  119. }
  120.  
  121. -- Icon (AP) example
  122. CreditShop_Items["armor"] = {
  123. Name = "200 Armor",
  124. Description = "Gives you 200 armor. (Maximum 200 armor allowed)",
  125. InDepthDescription = "Gives you 200 armor. (Maximum 200 armor allowed)",
  126. Model = "models/props_junk/garbage_plasticbottle003a.mdl",
  127. Price = 1500,
  128. PM = false,
  129. Icon = true,
  130. IconImg = "materials/credit_shop/armor.png",
  131. OnPurFunction =
  132. function(ply,item)
  133. local ArmorToGive = 200
  134. local MaxArmor = 200
  135.  
  136. if ply:Health() + ArmorToGive < MaxArmor then
  137. ply:SetArmor(ply:Health() + ArmorToGive)
  138. else
  139. ply:SetArmor(MaxArmor)
  140. end
  141. end,
  142. }
  143.  
  144. -- Icon (Weapon) example
  145. CreditShop_Items["minigun"] = {
  146. Name = "Minigun",
  147. Description = "Gives you a minigun!",
  148. InDepthDescription = "Gives you a minigun!",
  149. Model = "models/weapons/w_m134_minigun.mdl",
  150. Price = 15000,
  151. PM = false,
  152. Icon = false,
  153. OnPurFunction =
  154. function(ply,item)
  155. ply:Give( "m9k_minigun" )
  156. end,
  157. }
  158.  
  159. -- Permanent weapon example2
  160. CreditShop_Items["perm_shotgun"] = {
  161. Name = "Perma Double Barrel",
  162. Description = "Gives you a Permanent Shotgun!",
  163. InDepthDescription = "Gives you a Permanent Shotgun!",
  164. Model = "models/weapons/w_shotgun.mdl",
  165. PermClass = "weapon_shotgun",
  166. PermWep = true,
  167. Price = 20000,
  168. PM = false,
  169. Icon = false,
  170. OnPurFunction =
  171. function(ply,item)
  172. ply:Give( "m9k_dbarrel" )
  173. ply:CS_AddPermWep( "m9k_dbarrel" )
  174. end,
  175. }
  176.  
  177. CreditShop_Items["perm_smg"] = {
  178. Name = "Perma Barret M82",
  179. Description = "Gives you a Sniper!",
  180. InDepthDescription = "Gives you a Sniper!",
  181. Model = "models/weapons/w_barret_m82.mdl",
  182. PermClass = "weapon_sniper",
  183. PermWep = true,
  184. Price = 25000,
  185. PM = false,
  186. Icon = false,
  187. OnPurFunction =
  188. function(ply,item)
  189. ply:Give( "m9k_barret_m82" )
  190. ply:CS_AddPermWep( "m9k_barret_m82" )
  191. end,
  192. }
  193.  
  194. -- Vehicle example
  195. CreditShop_Items["jeep"] = {
  196. Name = "Jeep",
  197. Description = "Gives you a Jeep!",
  198. InDepthDescription = "Gives you a Jeep!",
  199. Model = "models/buggy.mdl",
  200. Price = 15,
  201. PM = true,
  202. Icon = false,
  203. OnPurFunction =
  204. function(ply,item)
  205. local car = ents.Create("prop_vehicle_jeep_old")
  206. car:SetModel("models/buggy.mdl")
  207. car:SetKeyValue("vehiclescript","scripts/vehicles/jeep_test.txt")
  208. car:SetPos(ply:GetPos()-Vector( 0, 100, 0 ) )
  209. car:Spawn()
  210. end,
  211. }
  212.  
  213. end
  214.  
  215.  
  216. if( ItemSort == "High_Low" ) then
  217. table.sort(CreditShop_Items, function(a, b) return a.Price > b.Price end);
  218. elseif( ItemSort == "Low_High" ) then
  219. table.sort(CreditShop_Items, function(a, b) return a.Price < b.Price end);
  220. end
  221.  
  222. // PRESET CONFIG
  223.  
  224. --PRESETS--
  225.  
  226. --[[--
  227. CreditShop_Presets[1] = {
  228. Name = "Tropical Preset", --Preset Name
  229. TextColor = Color(120,120,120,255), --Preset Text color
  230. ThemeColor = Color(0,238,255,150) --Preset Theme color
  231. }
  232.  
  233. CreditShop_Presets[5] = {
  234. Name = "Rainbow Preset", --Preset Name
  235. Flash = true, --Should the preset constantly change colors
  236. TextColor = Color(255,255,255,255), --Preset Text Color
  237. minRed = 0, -- Minimum Red
  238. maxRed = 255, -- Maximum Red
  239. minGreen = 0, -- Minimum Green
  240. maxGreen = 255, -- Maximum Green
  241. minBlue = 0, -- Minimum Blue
  242. maxBlue = 255, -- Maximum Blue
  243. Alpha = 200 -- Alpha ( opacity )
  244. }
  245. --]]--
  246.  
  247.  
  248. CreditShop_Presets = {} --IGNORE
  249.  
  250. CreditShop_Presets[1] = {
  251. Name = "Red Preset",
  252. TextColor = Color(255,174,174,255),
  253. ThemeColor = Color(255,0,0,150)
  254. }
  255.  
  256. CreditShop_Presets[2] = {
  257. Name = "Orange Preset",
  258. TextColor = Color(255,234,174,255),
  259. ThemeColor = Color(255,144,0,175)
  260. }
  261.  
  262. CreditShop_Presets[3] = {
  263. Name = "Yellow Preset",
  264. TextColor = Color(255,255,196,255),
  265. ThemeColor = Color(255,255,0,184)
  266. }
  267.  
  268. CreditShop_Presets[4] = {
  269. Name = "Green Preset",
  270. TextColor = Color(211,255,210,255),
  271. ThemeColor = Color(12,255,0,200)
  272. }
  273.  
  274. CreditShop_Presets[5] = {
  275. Name = "Light Blue Preset",
  276. TextColor = Color(255,255,255,255),
  277. ThemeColor = Color(0,255,242,200)
  278. }
  279.  
  280. CreditShop_Presets[6] = {
  281. Name = "Blue Preset",
  282. TextColor = Color(142,142,255,255),
  283. ThemeColor = Color(0,4,255,200)
  284. }
  285.  
  286. CreditShop_Presets[7] = {
  287. Name = "Pink Preset",
  288. TextColor = Color(251,160,255,255),
  289. ThemeColor = Color(255,0,238,200)
  290. }
  291.  
  292. CreditShop_Presets[8] = {
  293. Name = "Purple Preset",
  294. TextColor = Color(178,0,157,236),
  295. ThemeColor = Color(126,0,161,236)
  296. }
  297.  
  298. CreditShop_Presets[9] = {
  299. Name = "Sun Preset",
  300. TextColor = Color(255,0,0,255),
  301. ThemeColor = Color(198,66,0,150)
  302. }
  303.  
  304. CreditShop_Presets[10] = {
  305. Name = "Dark Preset",
  306. TextColor = Color(255,255,255,255),
  307. ThemeColor = Color(0,0,0,255)
  308. }
  309.  
  310. CreditShop_Presets[11] = {
  311. Name = "Tropical Preset",
  312. TextColor = Color(120,120,120,255),
  313. ThemeColor = Color(0,238,255,150)
  314. }
  315.  
  316. CreditShop_Presets[12] = {
  317. Name = "Rainbow Preset",
  318. Flash = true,
  319. TextColor = Color(255,255,255,255),
  320. minRed = 0,
  321. maxRed = 255,
  322. minGreen = 0,
  323. maxGreen = 255,
  324. minBlue = 0,
  325. maxBlue = 255,
  326. Alpha = 200
  327. }
  328.  
  329. CreditShop_Presets[13] = {
  330. Name = "Red Mayhem Preset",
  331. Flash = true,
  332. TextColor = Color(255,255,255,255),
  333. minRed = 0,
  334. maxRed = 255,
  335. minGreen = 0,
  336. maxGreen = 0,
  337. minBlue = 0,
  338. maxBlue = 0,
  339. Alpha = 200
  340. }
  341.  
  342. CreditShop_Presets[14] = {
  343. Name = "Green Mayhem Preset",
  344. Flash = true,
  345. TextColor = Color(255,255,255,255),
  346. minRed = 0,
  347. maxRed = 0,
  348. minGreen = 0,
  349. maxGreen = 255,
  350. minBlue = 0,
  351. maxBlue = 0,
  352. Alpha = 200
  353. }
  354.  
  355. CreditShop_Presets[15] = {
  356. Name = "Blue Mayhem Preset",
  357. Flash = true,
  358. TextColor = Color(255,255,255,255),
  359. minRed = 0,
  360. maxRed = 0,
  361. minGreen = 0,
  362. maxGreen = 0,
  363. minBlue = 0,
  364. maxBlue = 255,
  365. Alpha = 200
  366. }
  367.  
  368. CreditShop_Presets[16] = {
  369. Name = "White Mayhem Preset",
  370. Flash = true,
  371. TextColor = Color(255,255,255,255),
  372. minRed = 200,
  373. maxRed = 255,
  374. minGreen = 200,
  375. maxGreen = 255,
  376. minBlue = 200,
  377. maxBlue = 255,
  378. Alpha = 200
  379. }
  380.  
  381. //IGNORE
  382. function formatCredits( num ) -- Formats a number like this "10,000 Credits", saves space
  383. return string.Comma(num).." Credits"
  384. end
  385.  
  386. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement