Guest User

Untitled

a guest
May 25th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.84 KB | None | 0 0
  1.  
  2. shopData = {}
  3. function AddShopItem( item, name, desc, price, type, preview, weapon )
  4. table.insert( shopData, { item = item, Name = name, Desc = desc, Cost = price, Type = type, Preview = preview, Weapon = weapon or nil } )
  5. end
  6.  
  7. // Hats
  8. AddShopItem( "bucket", "Bucket", "Makes you look silly", 1000, "HAT", "models/props_junk/MetalBucket01a.mdl" )
  9. AddShopItem( "egg", "Egg", "Breakfast in-game", 1000, "HAT", "models/props_phx/misc/egg.mdl" )
  10. AddShopItem( "barrelhat", "Barrel Hat", "A barrel", 1000, "HAT", "models/props_c17/oildrum001_explosive.mdl" )
  11. AddShopItem( "sodahat", "Soda Hat", "A soda can", 1000, "HAT", "models/props_junk/PopCan01a.mdl" )
  12. AddShopItem( "traffichat", "Traffic Cone", "Usefull in traffic", 5000, "HAT", "models/props_junk/TrafficCone001a.mdl" )
  13. AddShopItem( "sombrero", "Sombrero", "Chuck Noris has one", 5000, "HAT", "models/props_junk/sawblade001a.mdl" )
  14. AddShopItem( "headcrab", "Headcrab", "Might turn you into a zombie", 2000, "HAT", "models/Nova/w_headcrab.mdl" )
  15. AddShopItem( "baseball", "Baseball Cap", "Time to hit a homerun", 3000, "HAT", "models/props/cs_office/Snowman_hat.mdl" )
  16. AddShopItem( "microwave", "Microwave Head", "Make sure traitors don't heal", 3000, "HAT", "models/props/cs_office/microwave.mdl" )
  17. AddShopItem( "combine", "Combine Mask", "Buy this in the name of the law", 3000, "HAT", "models/Nova/w_headgear.mdl" )
  18. AddShopItem( "bomb", "Bomb Head", "Don't blow up", 3000, "HAT", "models/Combine_Helicopter/helicopter_bomb01.mdl" )
  19. AddShopItem( "Snowman", "Snowman Mask", "Merry Christmas", 4000, "HAT", "models/props/cs_office/Snowman_face.mdl" )
  20. AddShopItem( "Skull", "Skull Mask", "Are you dead?", 3000, "HAT", "models/Gibs/HGIBS.mdl" )
  21. AddShopItem( "Antlion", "Antlion Mask", "Be the beast", 3000, "HAT", "models/Gibs/Antlion_gib_Large_2.mdl" )
  22. AddShopItem( "RussianHat", "Russian Hat", "Soviets Favorite Hat?", 5000, "HAT", "models/russianhat1.mdl" )
  23. AddShopItem( "fo31", "Mask of Camo", "Mask of?", 20000, "HAT", "models/fo3_camo_mask.mdl" )
  24. AddShopItem( "fo32", "Mask of Skulls", "Mask of?", 15000, "HAT", "models/fo3_skull_mask.mdl" )
  25. AddShopItem( "fo33", "Mask of Talon", "Mask of?", 25000, "HAT", "models/fo3_talon_mask.mdl" )
  26. AddShopItem( "fo34", "Mask of Spawn", "Mask of?", 30000, "HAT", "models/fo3_spawn_mask.mdl" )
  27. AddShopItem( "fo35", "Mask of Soviet", "Mask of?", 50000, "HAT", "models/fo3_punisher_mask.mdl" )
  28. AddShopItem( "fo36", "Mask of MetalMan", "Mask of?", 20000, "HAT", "models/fo3_metal_mask.mdl" )
  29. AddShopItem( "fo37", "Mask of Jason", "Mask of?", 35000, "HAT", "models/fo3_jason_mask.mdl" )
  30. AddShopItem( "fo38", "Mask of Ironman", "Mask of?", 20000, "HAT", "models/fo3_ironman_mask.mdl" )
  31. AddShopItem( "fo39", "Mask of G", "Mask of?", 15000, "HAT", "models/fo3_gtool_mask.mdl" )
  32. AddShopItem( "fo40", "Mask of Punishers", "Mask of?", 20000, "HAT", "models/fo3_grim_mask.mdl" )
  33. AddShopItem( "fo41", "Mask of Flags", "Mask of?", 25000, "HAT", "models/fo3_flag_mask.mdl" )
  34. AddShopItem( "fo41", "Mask of Aqua", "Mask of?", 12000, "HAT", "models/fo3_aqua_mask.mdl" )
  35. AddShopItem( "helmet", "Space helmet", "You can survive on the moon now.", 13000, "HAT", "models/astronauthelmet/astronauthelmet.mdl" )
  36. AddShopItem( "afro", "Afro", "For Kleiner..", 10000, "HAT", "models/gmod_tower/afro.mdl" )
  37. AddShopItem( "santa", "Santa", "For christmas", 20000, "HAT", "models/santahat/santahat.mdl" )
  38. AddShopItem( "viking", "Viking helmet", "All got raped by meteor strike", 3000, "HAT", "models/vikinghelmet/vikinghelmet.mdl" )
  39. AddShopItem( "antler", "Antlers", "The hunt has begun", 40000, "HAT", "models/sam/antlers.mdl" )
  40. AddShopItem( "dunce", "Dunce hat", "Proof you're not smart", 1000, "HAT", "models/duncehat/duncehat.mdl" )
  41. AddShopItem( "majoramask", "Majorasmask", "The fuck is this shit?", 50000, "HAT", "models/gmod_tower/majorasmask.mdl" )
  42. AddShopItem( "tophat", "Tophat", "For rich kiddies", 90000, "HAT", "models/gmod_tower/tophat.mdl" )
  43. AddShopItem( "toromask", "Toromask", "Don't ask", 30000, "HAT", "models/gmod_tower/toromask.mdl" )
  44. AddShopItem( "toetoehat", "Toeto Hat", "Buy this beacuze I tell you", 10000, "HAT", "models/gmod_tower/toetohat.mdl" )
  45. AddShopItem( "starglasses", "Star Glasses", "You need glasses", 10000, "HAT", "models/gmod_tower/starglasses.mdl" )
  46. AddShopItem( "linkhat", "Link Hat", "What is this I don't even", 10000, "HAT", "models/gmod_tower/linkhat.mdl" )
  47.  
  48. // Models
  49. AddShopItem( "barney", "Barney", "About that beer...", 1000, "MODEL", "models/player/barney.mdl" )
  50. AddShopItem( "kleiner", "Kleiner", "Mingebag model", 1000, "MODEL", "models/player/kleiner.mdl" )
  51. AddShopItem( "monk", "Priest", "Gah, don't ever buy this", 20, "MODEL", "models/player/monk.mdl" )
  52. AddShopItem( "eli", "Eli", "Extra leg not included", 500, "MODEL", "models/player/eli.mdl" )
  53. AddShopItem( "Citizen1", "Citizen", "yup", 500, "MODEL", "models/player/Group01/male_02.mdl" )
  54. AddShopItem( "Citizen2", "Citizen2", "yup", 500, "MODEL", "models/player/Group01/male_07.mdl" )
  55. AddShopItem( "Alyx", "Alyx", "yup", 500, "MODEL", "models/player/alyx.mdl" )
  56.  
  57. // Trails
  58. AddShopItem( "plasma", "Plasma", "Default trail", 100, "TRAIL", "trails/plasma.vmt" )
  59. AddShopItem( "laser", "Laser", "Laser trail", 500, "TRAIL", "trails/laser.vmt" )
  60. AddShopItem( "lol", "Lol", "Lol laser", 500, "TRAIL", "trails/lol.vmt" )
  61. AddShopItem( "smoke", "Smoke", "Smoke laser", 700, "TRAIL", "trails/smoke.vmt" )
  62. AddShopItem( "love", "Love", "Love trail", 800, "TRAIL", "trails/love.vmt" )
  63. AddShopItem( "physbeam", "Physbeam", "Physbeam traim", 1000, "TRAIL", "trails/physbeam.vmt" )
  64. AddShopItem( "tube", "Tube", "Tube trail", 1200, "TRAIL", "trails/tube.vmt" )
  65.  
  66. // Weapons
  67. AddShopItem( "ak47", "AK47", "Powerful weapon", 10000, "WEAPON", "models/weapons/w_rif_ak47.mdl", "weapon_ttt_ak47" )
  68. AddShopItem( "m16", "M16", "Powerful weapon", 10000, "WEAPON", "models/weapons/w_rif_m4a1.mdl", "weapon_ttt_m16" )
  69. AddShopItem( "ak74", "AK47", "Powerful weapon", 10000, "WEAPON", "models/weapons/w_rif_ak47.mdl", "weapon_ttt_ak47" )
  70. AddShopItem( "M4A1", "M4A1", "Powerful weapon", 10000, "WEAPON", "models/weapons/w_rif_m4a1.mdl", "weapon_ttt_m4a1" )
  71. AddShopItem( "Mp7", "Donator MP7", "Powerful weapon", 20000, "WEAPON", "models/weapons/w_smg1.mdl", "weapon_ttt_mp7" )
  72. AddShopItem( "Spas", "Donator Spas-12", "Powerful weapon", 20000, "WEAPON", "models/weapons/w_shot_m3super90.mdl", "weapon_ttt_spas12" )
  73. AddShopItem( "nyan", "Donator Nyan", "Powerful weapon", 10000, "WEAPON", "models/weapons/w_rocket_launcher.mdl", "weapon_ttt_nyan" )
  74. AddShopItem( "sniper", "Sniper", "Powerful weapon", 10000, "WEAPON", "models/weapons/w_snip_scout.mdl", "weapon_zm_rifle" )
  75. AddShopItem( "deagle", "Desert Eagle", "Powerful weapon", 10000, "WEAPON", "models/weapons/w_pist_deagle.mdl", "weapon_zm_revolver" )
  76.  
  77. HatPos = {}
  78. HatPos["models/props_junk/MetalBucket01a.mdl"] = { Pos = Vector(5.2,-2,0), Ang = Angle(0,20,90), Model = "models/props_junk/MetalBucket01a.mdl" }
  79. HatPos["models/props_phx/misc/egg.mdl"] = { Pos = Vector(-3,1.5,0), Ang = Angle(0,-180,90), ScaleVector = Vector (3.3,3.3,3.3), Model = "models/props_phx/misc/egg.mdl" }
  80. HatPos["models/props_c17/oildrum001_explosive.mdl"] = { Pos = Vector(-3.5,0.5,0.8), Ang = Angle(90,180,90), ScaleVector = Vector (0.5,0.5,0.5), Model = "models/props_c17/oildrum001_explosive.mdl" }
  81. HatPos["models/props_junk/PopCan01a.mdl"] = { Pos = Vector(5.2,0.5,0.8), Ang = Angle(90,180,90), ScaleVector = Vector (3,3,3), Model = "models/props_junk/PopCan01a.mdl" }
  82. HatPos["models/props_junk/TrafficCone001a.mdl"] = { Pos = Vector(18,0,0), Ang = Angle(0,0,-90), ScaleVector = Vector (1,1,1), Model = "models/props_junk/TrafficCone001a.mdl" }
  83. HatPos["models/props_junk/sawblade001a.mdl"] = { Pos = Vector(4.6,0.5,0), Ang = Angle(-90,0,-75), Model = "models/props_junk/sawblade001a.mdl" }
  84. HatPos["models/Nova/w_headcrab.mdl"] = { Pos = Vector(-2.5,0,0), Ang = Angle(0,-90,90), ScaleVector = Vector (1.1,1.1,1.1), Model = "models/Nova/w_headcrab.mdl" }
  85. HatPos["models/props/cs_office/Snowman_hat.mdl"] = { Pos = Vector(3.5,-2.3,0), Ang = Angle(0,50,-90), Model = "models/props/cs_office/Snowman_hat.mdl" }
  86. HatPos["models/props/cs_office/microwave.mdl"] = { Pos = Vector( 0, 1, 0 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 0.75, 0.75,0.75 ), Model = "models/props/cs_office/microwave.mdl" }
  87. HatPos["models/Nova/w_headgear.mdl"] = { Pos = Vector( 0, 0, 0 ), Ang = Angle( -90, 270, 0 ), Model = "models/Nova/w_headgear.mdl" }
  88. HatPos["models/Combine_Helicopter/helicopter_bomb01.mdl"] = { Pos = Vector( 0, 0, 0 ), Ang = Angle( 0, 0, 0 ), ScaleVector = Vector( 0.5, 0.5, 0.5 ), Model = "models/Combine_Helicopter/helicopter_bomb01.mdl" }
  89. HatPos["models/props/cs_office/Snowman_face.mdl"] = { Pos = Vector( 2, 0, 0 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/props/cs_office/Snowman_face.mdl" }
  90. HatPos["models/Gibs/HGIBS.mdl"] = { Pos = Vector( 1, 0, 0 ), Ang = Angle( 90, 180, 90 ), ScaleVector = Vector( 2, 2, 2 ), Model = "models/Gibs/HGIBS.mdl" }
  91. HatPos["models/Gibs/Antlion_gib_Large_2.mdl"] = { Pos = Vector( 0, 0, 0 ), Ang = Angle( 90, 180, 90 ), Model = "models/Gibs/Antlion_gib_Large_2.mdl" }
  92. HatPos["models/russianhat1.mdl"] = { Pos = Vector( -7.5, -3.5, 0 ), Ang = Angle( 90, 0, -75 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/russianhat1.mdl" }
  93. HatPos["models/fo3_camo_mask.mdl"] = { Pos = Vector( -2, 1, -4.5 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/fo3_camo_mask.mdl" }
  94. HatPos["models/fo3_skull_mask.mdl"] = { Pos = Vector( -2, 1, -4.5 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/fo3_skull_mask.mdl" }
  95. HatPos["models/fo3_talon_mask.mdl"] = { Pos = Vector( -2, 1, -4.5 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/fo3_talon_mask.mdl" }
  96. HatPos["models/fo3_spawn_mask.mdl"] = { Pos = Vector( -2, 1, -4.5 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/fo3_spawn_mask.mdl" }
  97. HatPos["models/fo3_punisher_mask.mdl"] = { Pos = Vector( -2.5, 1, -4.5 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/fo3_punisher_mask.mdl" }
  98. HatPos["models/fo3_metal_mask.mdl"] = { Pos = Vector( -2, 1, -4.5 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/fo3_metal_mask.mdl" }
  99. HatPos["models/fo3_jason_mask.mdl"] = { Pos = Vector( -2, 1, -4.5 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/fo3_jason_mask.mdl" }
  100. HatPos["models/fo3_ironman_mask.mdl"] = { Pos = Vector( -2, 1, -4.5 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/fo3_ironman_mask.mdl" }
  101. HatPos["models/fo3_gtool_mask.mdl"] = { Pos = Vector( -2, 1, -4.5 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/fo3_gtool_mask.mdl" }
  102. HatPos["models/fo3_grim_mask.mdl"] = { Pos = Vector( -2, 1, -4.5 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/fo3_grim_mask.mdl" }
  103. HatPos["models/fo3_flag_mask.mdl"] = { Pos = Vector( -2, 1, -4.5 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/fo3_flag_mask.mdl" }
  104. HatPos["models/fo3_aqua_mask.mdl"] = { Pos = Vector( -2, 1, -4.5 ), Ang = Angle( 0, 180, 90 ), ScaleVector = Vector( 1.2, 1.2, 1.2 ), Model = "models/fo3_aqua_mask.mdl" }
  105. HatPos["models/astronauthelmet/astronauthelmet.mdl"] = { Pos = Vector( -3, 0, 0 ), Ang = Angle( 90, 180, 90 ), Model = "models/astronauthelmet/astronauthelmet.mdl" }
  106. HatPos["models/gmod_tower/afro.mdl"] = { Pos = Vector( 5, -4, 0 ), Ang = Angle( 90, 0, 180 ), Model = "models/gmod_tower/afro.mdl" }
  107. HatPos["models/santahat/santahat.mdl"] = { Pos = Vector( 5, 0, 0 ), Ang = Angle( 90, 180, -270 ), Model = "models/santahat/santahat.mdl" }
  108. HatPos["models/vikinghelmet/vikinghelmet.mdl"] = { Pos = Vector( 5, 0, 0 ), Ang = Angle( 90, 180, -270 ), Model = "models/vikinghelmet/vikinghelmet.mdl" }
  109. HatPos["models/sam/antlers.mdl"] = { Pos = Vector( 5, 0, 0 ), Ang = Angle( 90, 180, -270 ), Model = "models/sam/antlers.mdl" }
  110. HatPos["models/duncehat/duncehat.mdl"] = { Pos = Vector( 5, 0, 0 ), Ang = Angle( 90, 180, -270 ), ScaleVector = Vector( 0.9, 0.9, 0.9 ), Model = "models/duncehat/duncehat.mdl" }
  111. HatPos["models/gmod_tower/majorasmask.mdl"] = { Pos = Vector( 2, 1, 0 ), Ang = Angle( -90, 0, -90 ), Model = "models/gmod_tower/majorasmask.mdl" }
  112. HatPos["models/gmod_tower/tophat.mdl"] = { Pos = Vector( 5, 0, 0 ), Ang = Angle( 0, -180, 90 ), Model = "models/gmod_tower/tophat.mdl" }
  113. HatPos["models/gmod_tower/toromask.mdl"] = { Pos = Vector( 3, 0, 0 ), Ang = Angle( -90, 0, -90 ), Model = "models/gmod_tower/toromask.mdl" }
  114. HatPos["models/gmod_tower/toetohat.mdl"] = { Pos = Vector( 5, 0, 0 ), Ang = Angle( -90, 0, -90 ), Model = "models/gmod_tower/toetohat.mdl" }
  115. HatPos["models/gmod_tower/starglasses.mdl"] = { Pos = Vector( 4, 2, 0 ), Ang = Angle( 90, 180, 90 ), Model = "models/gmod_tower/starglasses.mdl" }
  116. HatPos["models/gmod_tower/linkhat.mdl"] = { Pos = Vector( 4, -2, 0 ), Ang = Angle( 90, 180, -270 ), Model = "models/gmod_tower/linkhat.mdl" }
  117.  
  118. for k, v in pairs( shopData ) do
  119. if shopData[k].Type == "MODEL" or shopData[k].Type == "HAT" then
  120. util.PrecacheModel( shopData[k].Preview )
  121. end
  122. end
  123.  
  124. function SHOP:GetItem( item )
  125. if not item then return end
  126.  
  127. for k, v in pairs( shopData ) do
  128. if tostring(item) == shopData[k].item then
  129. return v
  130. end
  131. end
  132.  
  133. return nil
  134. end
  135.  
  136. function SHOP:SpawnHat( pl, h )
  137. if not pl then return end
  138. if not pl.PlayerData then return end
  139.  
  140. pl.PlayerData["hat"] = h
  141.  
  142. if ValidEntity( pl.Hat ) then
  143. pl.Hat:Remove( )
  144.  
  145. pl.Hat = ents.Create( "sent_hat" )
  146. pl.Hat:SetPos( pl:GetPos( ) )
  147. pl.Hat:SetOwner( pl )
  148. pl.Hat:SetParent( pl )
  149. pl.Hat:SetHat( h )
  150. pl.Hat:Spawn( )
  151. return
  152. end
  153.  
  154. pl.Hat = ents.Create( "sent_hat" )
  155. pl.Hat:SetModel( h )
  156. pl.Hat:SetPos( pl:GetPos( ) )
  157. pl.Hat:SetOwner( pl )
  158. pl.Hat:SetParent( pl )
  159. pl.Hat:SetHat( h )
  160. pl.Hat:Spawn( )
  161.  
  162. SHOP:SavePlayer( pl )
  163. end
Add Comment
Please, Sign In to add comment