Advertisement
Guest User

umsg late menu

a guest
Nov 5th, 2010
24
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local mainlevel = 1
  2. local totallevel = 21
  3.  
  4. local hitpoints = 10
  5. local strength = 1
  6. local defense = 1
  7. local mining = 1
  8. local woodcutting = 1
  9. local smithing = 1
  10. local firemaking = 1
  11. local cooking = 1
  12. local fishing = 1
  13. local tailoring = 1
  14. local prayer = 1
  15. local farming = 1
  16.  
  17. local hitpointsxp = 1
  18. local strengthxp = 1
  19. local defensexp = 1
  20. local miningxp = 1
  21. local woodcuttingxp = 1
  22. local smithingxp = 1
  23. local firemakingxp = 1
  24. local cookingxp = 1
  25. local fishingxp = 1
  26. local tailoringxp = 1
  27. local prayerxp = 1
  28. local farmingxp = 1
  29.  
  30.  
  31.  
  32. function main_menu()
  33.  
  34. Mainmenu = vgui.Create("DFrame")
  35. Mainmenu:SetPos(ScrW() / 4,ScrH() / 4)
  36. Mainmenu:SetSize(ScrW() / 2, ScrH() / 2+50)
  37. Mainmenu:SetTitle("Main Menu")
  38. Mainmenu:SetDraggable(true)
  39. Mainmenu:ShowCloseButton(true)
  40. Mainmenu:SetVisible(true)
  41. Mainmenu:MakePopup()
  42.  
  43. MNick = vgui.Create("DLabel",Mainmenu)
  44. MNick:SetText("Name : "..LocalPlayer():Nick() )
  45. MNick:SetPos(20,ScrH()/2)
  46. MNick:SizeToContents()
  47.  
  48. MTotalLvl = vgui.Create("DLabel",Mainmenu)
  49. MTotalLvl:SetText("Total lvl : "..totallevel.." Main lvl : "..mainlevel )
  50. MTotalLvl:SetPos(20,ScrH()/2+20)
  51. MTotalLvl:SizeToContents()
  52.  
  53. if (inventory != nil) then
  54.  
  55. MGold = vgui.Create("DLabel",Mainmenu)
  56. MGold:SetText("Gold : "..inventory.gold )
  57. MGold:SetPos(250,ScrH()/2)
  58. MGold:SizeToContents()
  59.  
  60. MAmount = vgui.Create("DLabel",Mainmenu)
  61. MAmount:SetText("Inventory "..inventory.amount.." / "..inventory.capacity)
  62. MAmount:SetPos(250,ScrH()/2+20)
  63. MAmount:SizeToContents()
  64.  
  65. end
  66.  
  67. Menu1 = vgui.Create("DPanel")
  68. Menu1:SetSize(ScrW() / 2-15,ScrH() / 2-50)
  69.  
  70. Menu2 = vgui.Create("DPanel")
  71. Menu2:SetSize(ScrW() / 2-15,ScrH() / 2-50)
  72.  
  73. local Menu3 = vgui.Create( "DPanelList" )
  74. Menu3:EnableVerticalScrollbar( true )
  75. Menu3:EnableHorizontal( false )
  76. Menu3:SetSpacing( 5 )
  77. Menu3:SetPadding( 5 )
  78. Menu3:SetPos(5,5)
  79. Menu3:SetSize(200,ScrH() / 2-50)
  80.  
  81.  
  82. function Inventory_Setup ( cucc, id, inv, data )
  83.  
  84. resources = {}
  85. inventory = {}
  86.  
  87. resources = data.Resources
  88. inventory = data.Inventory
  89.  
  90.    
  91. end
  92.  
  93. if (inventory != nil) then
  94.  
  95.     for k,v in pairs(inventory) do
  96.    
  97.         Item = k
  98.         Amount = v
  99.  
  100.         if (Item == "amount") then
  101.        
  102.         elseif (Item == "capacity") then
  103.        
  104.         elseif (Item == "gold") then
  105.        
  106.         elseif (Amount > 0) then
  107.    
  108.         local Panel1 = vgui.Create('DPanel')
  109.         Panel1:SetSize(200,50)
  110.        
  111.         local Name = vgui.Create("DLabel", Panel1)
  112.         Name:SetPos(10,10)
  113.         Name:SetText("Item : "..resources[Item].name )
  114.         Name:SetFont("DefaultFixedOutline")
  115.         Name:SizeToContents()
  116.        
  117.         local Value = vgui.Create("DLabel", Panel1)
  118.         Value:SetPos(10,30)
  119.         Value:SetText("Value : "..Amount)
  120.         Value:SetFont("DefaultFixedOutline")
  121.         Value:SizeToContents()
  122.        
  123.         local Drop = vgui.Create("DButton", Panel1)
  124.         Drop:SetPos(150,10)
  125.         Drop:SetSize(50,30)
  126.         Drop:SetText("Drop")
  127.        
  128.         if table.HasValue( Resources.fishing , Item) then
  129.        
  130.         local Eat = vgui.Create("DButton", Panel1)
  131.         Eat:SetPos(220,10)
  132.         Eat:SetSize(50,30)
  133.         Eat:SetText("Eat")
  134.         Eat.DoClick = function()
  135.        
  136.             Food = k
  137.            
  138.             RunConsoleCommand("DA_InvEat",Food)
  139.  
  140.             end
  141.        
  142.         end
  143.        
  144.         Menu3:AddItem(Panel1)
  145.        
  146.         end
  147.        
  148.     end
  149.  
  150. end
  151.  
  152.  
  153.  
  154. Clan = vgui.Create("DButton",Menu1)
  155. Clan:SetPos(20,20)
  156. Clan:SetSize(100,30)
  157. Clan:SetText("Clans")
  158. Clan.DoClick = function()
  159.     RunConsoleCommand("DA_Clan")
  160. end
  161.  
  162. CreateClan = vgui.Create("DButton",Menu1)
  163. CreateClan:SetPos(20,70)
  164. CreateClan:SetSize(100,30)
  165. CreateClan:SetText("Create Clan")
  166. CreateClan.DoClick = function()
  167.     RunConsoleCommand("DA_CreateClan")
  168. end
  169.  
  170. JoinClan = vgui.Create("DButton",Menu1)
  171. JoinClan:SetPos(120,70)
  172. JoinClan:SetSize(100,30)
  173. JoinClan:SetText("Join Clan")
  174. JoinClan.DoClick = function()
  175.     RunConsoleCommand("DA_JoinClan")
  176. end
  177.  
  178.  
  179.  
  180.  
  181. Save = vgui.Create("DButton",Menu1)
  182. Save:SetPos(20,120)
  183. Save:SetSize(100,30)
  184. Save:SetText("Save Character")
  185. Save.DoClick = function()
  186.  
  187.     RunConsoleCommand("DA_Save",Char)
  188.    
  189. end
  190.  
  191. function DA_Skills(data_cb)
  192.  
  193. totallevel = data_cb:ReadShort()
  194. mainlevel = data_cb:ReadShort()
  195.  
  196. strength = data_cb:ReadShort()
  197. hitpoints = data_cb:ReadShort()
  198. defense = data_cb:ReadShort()
  199. mining = data_cb:ReadShort()
  200. woodcutting = data_cb:ReadShort()
  201. smithing = data_cb:ReadShort()
  202. firemaking = data_cb:ReadShort()
  203. cooking = data_cb:ReadShort()
  204. fishing = data_cb:ReadShort()
  205. tailoring = data_cb:ReadShort()
  206. prayer = data_cb:ReadShort()
  207. farming = data_cb:ReadShort()
  208.  
  209. strengthxp = data_cb:ReadShort()
  210. hitpointsxp = data_cb:ReadShort()
  211. defensexp = data_cb:ReadShort()
  212. miningxp = data_cb:ReadShort()
  213. woodcuttingxp = data_cb:ReadShort()
  214. smithingxp = data_cb:ReadShort()
  215. firemakingxp = data_cb:ReadShort()
  216. cookingxp = data_cb:ReadShort()
  217. fishingxp = data_cb:ReadShort()
  218. tailoringxp = data_cb:ReadShort()
  219. prayerxp = data_cb:ReadShort()
  220. farmingxp = data_cb:ReadShort()
  221.  
  222. end
  223.  
  224.  
  225.  
  226. Nick = vgui.Create("DLabel",Menu2)
  227. Nick:SetText("Name : "..LocalPlayer():Nick() )
  228. Nick:SetPos(20,20)
  229. Nick:SetTextColor( Color(100,100,100,255) )
  230. Nick:SizeToContents()
  231.  
  232. SteamID = vgui.Create("DLabel",Menu2)
  233. SteamID:SetText("SteamID : "..LocalPlayer():SteamID() )
  234. SteamID:SetPos(20,40)
  235. SteamID:SetTextColor( Color(100,100,100,255) )
  236. SteamID:SizeToContents()
  237.  
  238. Clan = vgui.Create("DLabel",Menu2)
  239. Clan:SetText("Clan : "..team.GetName(LocalPlayer():Team() ) )
  240. Clan:SetPos(20,60)
  241. Clan:SetTextColor( Color(100,100,100,255) )
  242. Clan:SizeToContents()
  243.  
  244. Hitpoints = vgui.Create("DLabel",Menu2)
  245. Hitpoints:SetText("Hitpoints : "..hitpoints.." XP : "..hitpointsxp.." / "..LevelXP[hitpoints]  )
  246. Hitpoints:SetPos(20,100)
  247. Hitpoints:SetTextColor( Color(100,100,100,255) )
  248. Hitpoints:SizeToContents()
  249.  
  250. Strength = vgui.Create("DLabel",Menu2)
  251. Strength:SetText("Strength : "..strength.." XP : "..strengthxp.." / "..LevelXP[strength]  )
  252. Strength:SetPos(20,120)
  253. Strength:SetTextColor( Color(100,100,100,255) )
  254. Strength:SizeToContents()
  255.  
  256. Defense = vgui.Create("DLabel",Menu2)
  257. Defense:SetText("Defense : "..defense.." XP : "..defensexp.." / "..LevelXP[defense]  )
  258. Defense:SetPos(20,140)
  259. Defense:SetTextColor( Color(100,100,100,255) )
  260. Defense:SizeToContents()
  261.  
  262. MainLevel = vgui.Create("DLabel",Menu2)
  263. MainLevel:SetText("MainLevel : "..mainlevel)
  264. MainLevel:SetPos(20,160)
  265. MainLevel:SetTextColor( Color(100,100,100,255) )
  266. MainLevel:SizeToContents()
  267.  
  268. TotalLevel = vgui.Create("DLabel",Menu2)
  269. TotalLevel:SetText("Total Level : "..totallevel)
  270. TotalLevel:SetPos(20,180)
  271. TotalLevel:SetTextColor( Color(100,100,100,255) )
  272. TotalLevel:SizeToContents()
  273.  
  274. Mining = vgui.Create("DLabel",Menu2)
  275. Mining:SetText("Mining : "..mining.." XP : "..miningxp.." / "..LevelXP[mining] )
  276. Mining:SetPos(170,100)
  277. Mining:SetTextColor( Color(100,100,100,255) )
  278. Mining:SizeToContents()
  279.  
  280. Smithing = vgui.Create("DLabel",Menu2)
  281. Smithing:SetText("Smithing : "..smithing.." XP : "..smithingxp.." / "..LevelXP[smithing]  )
  282. Smithing:SetPos(170,120)
  283. Smithing:SetTextColor( Color(100,100,100,255) )
  284. Smithing:SizeToContents()
  285.  
  286. Woodcutting = vgui.Create("DLabel",Menu2)
  287. Woodcutting:SetText("Woodcutting : "..woodcutting.." XP : "..woodcuttingxp.." / "..LevelXP[woodcutting] )
  288. Woodcutting:SetPos(170,140)
  289. Woodcutting:SetTextColor( Color(100,100,100,255) )
  290. Woodcutting:SizeToContents()
  291.  
  292. Firemaking = vgui.Create("DLabel",Menu2)
  293. Firemaking:SetText("Firemaking : "..firemaking.." XP : "..firemakingxp.." / "..LevelXP[firemaking]  )
  294. Firemaking:SetPos(170,160)
  295. Firemaking:SetTextColor( Color(100,100,100,255) )
  296. Firemaking:SizeToContents()
  297.  
  298. Cooking = vgui.Create("DLabel",Menu2)
  299. Cooking:SetText("Cooking : "..cooking.." XP : "..cookingxp.." / "..LevelXP[cooking]  )
  300. Cooking:SetPos(170,180)
  301. Cooking:SetTextColor( Color(100,100,100,255) )
  302. Cooking:SizeToContents()
  303.  
  304. Fishing = vgui.Create("DLabel",Menu2)
  305. Fishing:SetText("Fishing : "..fishing.." XP : "..fishingxp.." / "..LevelXP[fishing] )
  306. Fishing:SetPos(340,100)
  307. Fishing:SetTextColor( Color(100,100,100,255) )
  308. Fishing:SizeToContents()
  309.  
  310. Tailoring = vgui.Create("DLabel",Menu2)
  311. Tailoring:SetText("Tailoring : "..tailoring.." XP : "..tailoringxp.." / "..LevelXP[tailoring]  )
  312. Tailoring:SetPos(340,120)
  313. Tailoring:SetTextColor( Color(100,100,100,255) )
  314. Tailoring:SizeToContents()
  315.  
  316. Prayer = vgui.Create("DLabel",Menu2)
  317. Prayer:SetText("Prayer : "..prayer.." XP : "..prayerxp.." / "..LevelXP[prayer] )
  318. Prayer:SetPos(340,140)
  319. Prayer:SetTextColor( Color(100,100,100,255) )
  320. Prayer:SizeToContents()
  321.  
  322. Farming = vgui.Create("DLabel",Menu2)
  323. Farming:SetText("Farming : "..farming.." XP : "..farmingxp.." / "..LevelXP[farming]  )
  324. Farming:SetPos(340,160)
  325. Farming:SetTextColor( Color(100,100,100,255) )
  326. Farming:SizeToContents()
  327.  
  328. MenuSheet = vgui.Create( "DPropertySheet" )
  329. MenuSheet:SetParent( Mainmenu )
  330. MenuSheet:SetPos(5,40)
  331. MenuSheet:SetSize(ScrW() / 2-15,ScrH() / 2-50)
  332.  
  333. MenuSheet:AddSheet( "Main Menu",Menu1,"gui/silkicons/user",false,false,"Main Menu")
  334. MenuSheet:AddSheet( "Info - Stats",Menu2,"gui/silkicons/user",false,false,"Info - Stats")
  335. MenuSheet:AddSheet( "Inventory",Menu3,"gui/silkicons/user",false,false,"Inventory")
  336.  
  337. usermessage.Hook(LocalPlayer():UniqueID().."Skills",DA_Skills)
  338. datastream.Hook("cucc", Inventory_Setup)
  339.  
  340. end
  341.  
  342.  
  343.  
  344.  
  345.  
  346. concommand.Add("DA_Main",main_menu)
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement