kizaru335

Untitled

Jun 17th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.21 KB | None | 0 0
  1.  
  2. -----------------------------------------------------
  3.  
  4. local category = "Jobs"
  5.  
  6. function OpenF4()
  7. local JobV
  8. local Desc = "Выберите профессию"
  9. if F4Frame and ValidPanel( F4Frame ) then
  10. CloseF4()
  11. else
  12. F4Frame = vgui.Create( "DFrame" )
  13. F4Frame:SetSize( 900, 600 )
  14. F4Frame:Center()
  15. F4Frame:SetTitle( "\tМеню Сервера" )
  16. F4Frame:SetDraggable( false )
  17. F4Frame:MakePopup()
  18. F4Frame:ShowCloseButton( true )
  19. end
  20.  
  21. F4Frame.Paint = function( self, w, h )
  22. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 64, 64, 200 ) )
  23. draw.RoundedBox( 0, 0, 0, w, 30, Color( 64, 0, 0, 240 ) )
  24. draw.RoundedBox( 0, 0, 20, w, 10, Color( 41, 0, 0, 240 ) )
  25. draw.RoundedBox( 0, 0, 30, 150, h - 30, Color( 64, 64, 64, 200 ) )
  26. draw.RoundedBox( 0, 600, 310, w - 600, h - 310, Color( 10, 10, 10, 200 ) )
  27. end
  28.  
  29. local pos = 0
  30.  
  31. local DScrollPanel = vgui.Create( "DScrollPanel",F4Frame )
  32. DScrollPanel:SetSize( 500, 565 )
  33. DScrollPanel:SetPos( 100, 35 )
  34.  
  35. local DScrollPanel2 = vgui.Create( "DScrollPanel",F4Frame )
  36. DScrollPanel2:SetSize( 300, 250 )
  37. DScrollPanel2:SetPos( 600, 310 )
  38.  
  39. local CategoryJobs = vgui.Create( "DButton", F4Frame )
  40. CategoryJobs:SetText( "Работы" )
  41. CategoryJobs:SetTextColor( Color( 255, 255, 255 ) )
  42. CategoryJobs:SetPos( 0, 35 )
  43. CategoryJobs:SetSize( 150, 30 )
  44. CategoryJobs:SetFont( "Trebuchet18" )
  45. CategoryJobs.DoClick = function()
  46. surface.PlaySound( "buttons/button9.wav" )
  47. category = "Jobs"
  48. RefreshUI()
  49. end
  50. CategoryJobs.Paint = function( self, w, h )
  51. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  52. end
  53.  
  54. local CategoryEntity = vgui.Create( "DButton", F4Frame )
  55. CategoryEntity:SetText( "Обьекты" )
  56. CategoryEntity:SetTextColor( Color( 255, 255, 255 ) )
  57. CategoryEntity:SetPos( 0, 70 )
  58. CategoryEntity:SetSize( 150, 30 )
  59. CategoryEntity:SetFont( "Trebuchet18" )
  60. CategoryEntity.DoClick = function()
  61. surface.PlaySound( "buttons/button9.wav" )
  62. category = "Entity"
  63. RefreshUI()
  64. end
  65. CategoryEntity.Paint = function( self, w, h )
  66. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  67. end
  68.  
  69. local CategoryWeapons = vgui.Create( "DButton", F4Frame )
  70. CategoryWeapons:SetText( "Оружие" )
  71. CategoryWeapons:SetTextColor( Color( 255, 255, 255 ) )
  72. CategoryWeapons:SetPos( 0, 105 )
  73. CategoryWeapons:SetSize( 150, 30 )
  74. CategoryWeapons:SetFont( "Trebuchet18" )
  75. CategoryWeapons.DoClick = function()
  76. pos = 0
  77. surface.PlaySound( "buttons/button9.wav" )
  78. category = "Weapons"
  79. RefreshUI()
  80. end
  81. CategoryWeapons.Paint = function( self, w, h )
  82. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  83. end
  84.  
  85.  
  86. local CategoryAmmo = vgui.Create( "DButton", F4Frame )
  87. CategoryAmmo:SetText( "Патроны" )
  88. CategoryAmmo:SetTextColor( Color( 255, 255, 255 ) )
  89. CategoryAmmo:SetPos( 0, 140 )
  90. CategoryAmmo:SetSize( 150, 30 )
  91. CategoryAmmo:SetFont( "Trebuchet18" )
  92. CategoryAmmo.DoClick = function()
  93. surface.PlaySound( "buttons/button9.wav" )
  94. category = "Ammo"
  95. RefreshUI()
  96. end
  97. CategoryAmmo.Paint = function( self, w, h )
  98. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  99. end
  100.  
  101. local CategoryCom = vgui.Create( "DButton", F4Frame )
  102. CategoryCom:SetText( "Команды" )
  103. CategoryCom:SetTextColor( Color( 255, 255, 255 ) )
  104. CategoryCom:SetPos( 0, 175 )
  105. CategoryCom:SetSize( 150, 30 )
  106. CategoryCom:SetFont( "Trebuchet18" )
  107. CategoryCom.DoClick = function()
  108. surface.PlaySound( "buttons/button9.wav" )
  109. category = "Com"
  110. RefreshUI()
  111. end
  112. CategoryCom.Paint = function( self, w, h )
  113. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  114. end
  115.  
  116.  
  117.  
  118. local ModelIcon = vgui.Create( "DModelPanel", F4Frame )
  119. ModelIcon:SetSize( 300, 300 )
  120. ModelIcon:SetPos(600,30)
  121. ModelIcon:SetModel( LocalPlayer():GetModel() )
  122.  
  123.  
  124.  
  125. local MakeMeJob = vgui.Create( "DButton", F4Frame )
  126. MakeMeJob:SetText( "Стать" )
  127. MakeMeJob:SetTextColor( Color( 255, 255, 255 ) )
  128. MakeMeJob:SetPos( 675, 565 )
  129. MakeMeJob:SetSize( 150, 30 )
  130. MakeMeJob:SetFont( "Trebuchet18" )
  131. MakeMeJob.DoClick = function()
  132. surface.PlaySound( "buttons/button9.wav" )
  133. if(JobV != nil)then
  134. if(JobV.vote != true)then
  135. RunConsoleCommand("darkrp", JobV.command)
  136. else
  137. RunConsoleCommand("darkrp", "vote" .. JobV.command)
  138. end
  139. end
  140. end
  141. MakeMeJob.Paint = function( self, w, h )
  142. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  143. end
  144.  
  145. local DLabel = vgui.Create( "DLabel", DScrollPanel2 )
  146. DLabel:SetText( Desc )
  147. DLabel:SetPos( 0, 0 )
  148. DLabel:SetSize(300,1000)
  149. DLabel:SetFont( "Trebuchet24" )
  150. DLabel:SetAutoStretchVertical( true )
  151. DLabel:SetWrap(true)
  152.  
  153. if(category == "Jobs") then
  154. for i, item in ipairs(RPExtraTeams) do
  155. local SI = true
  156. if SI == true then
  157. pos = pos + 35
  158. local Text = item.name
  159. if(item.status == "User")then
  160. Text = item.name
  161. else
  162. Text = item.name .. " (Только для " .. item.status .. ")"
  163. end
  164. local Button = vgui.Create( "DButton", DScrollPanel )
  165. Button:SetText( Text )
  166. Button:SetTextColor( Color( 255, 255, 255 ) )
  167. Button:SetPos( 55, pos - 35)
  168. Button:SetSize( 425, 30 )
  169. Button:SetFont( "Trebuchet18" )
  170. Button.DoClick = function()
  171. JobV = item
  172.  
  173. if istable( item['model'] ) then ModelIcon:SetModel( item['model'][1] ) else ModelIcon:SetModel( item['model'] ) end
  174.  
  175. Desc = item.description
  176.  
  177. DLabel:SetText( Desc )
  178. surface.PlaySound( "buttons/button9.wav" )
  179. end
  180. Button.Paint = function( self, w, h )
  181. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  182. end
  183.  
  184. local Icon = vgui.Create( "SpawnIcon", Button )
  185. Icon:SetSize( 30, 30 )
  186. Icon:SetPos( 0, 0 )
  187. if istable( item['model'] ) then Icon:SetModel( item['model'][1] ) else Icon:SetModel( item['model'] ) end
  188. end
  189. end
  190. end
  191.  
  192.  
  193. if(category == "Entity") then
  194. for i, item in ipairs(DarkRPEntities) do
  195. local SI = true
  196. if istable(item.allowed) and not table.HasValue( item.allowed, LocalPlayer():Team() )then
  197. SI = false
  198. end
  199. if SI == true then
  200. pos = pos + 35
  201. local Button = vgui.Create( "DButton", DScrollPanel )
  202. Button:SetText( item.name .. ", " .. item.price .. "₽" )
  203. Button:SetTextColor( Color( 255, 255, 255 ) )
  204. Button:SetPos( 55, pos - 35)
  205. Button:SetSize( 425, 30 )
  206. Button:SetFont( "Trebuchet18" )
  207. Button.DoClick = function()
  208. RunConsoleCommand("DarkRP", item.cmd)
  209. surface.PlaySound( "buttons/button9.wav" )
  210. F4Frame:Close()
  211. end
  212. Button.Paint = function( self, w, h )
  213. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  214. end
  215.  
  216. local Icon = vgui.Create( "SpawnIcon", Button )
  217. Icon:SetSize( 30, 30 )
  218. Icon:SetPos( 0, 0 )
  219. Icon:SetModel( item.model )
  220. end
  221. end
  222. end
  223.  
  224.  
  225. if(category == "Weapons") then
  226. for i, item in ipairs(CustomShipments) do
  227. local SI = false
  228. if table.HasValue(item.allowed, LocalPlayer():Team())then
  229. pos = pos + 35
  230. local Button1 = vgui.Create( "DButton", DScrollPanel )
  231. Button1:SetText( item.name .. ", " .. item.price .. "₽, " .. item.amount .. " штук")
  232. Button1:SetTextColor( Color( 255, 255, 255 ) )
  233. Button1:SetPos( 55, pos - 35)
  234. Button1:SetSize( 425, 30 )
  235. Button1:SetFont( "Trebuchet18" )
  236. Button1.DoClick = function()
  237. RunConsoleCommand("DarkRP", "buyshipment", item.name)
  238. surface.PlaySound( "buttons/button9.wav" )
  239. F4Frame:Close()
  240. end
  241. Button1.Paint = function( self, w, h )
  242. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  243. end
  244.  
  245. local Icon = vgui.Create( "SpawnIcon", Button1 )
  246. Icon:SetSize( 30, 30 )
  247. Icon:SetPos( 0, 0 )
  248. Icon:SetModel( item.model )
  249. end
  250. end
  251. end
  252.  
  253.  
  254. if(category == "Ammo") then
  255. for i, item in ipairs(GAMEMODE.AmmoTypes) do
  256. local SI = true
  257. if istable(item.allowed) and table.Count(item.allowed) >= 1 and not table.HasValue( item.allowed, LocalPlayer():Team() ) then SI = false end
  258. if SI == true then
  259. pos = pos + 35
  260. local Button1 = vgui.Create( "DButton", DScrollPanel )
  261. Button1:SetText( item.name .. ", " .. item.price .. "₽" )
  262. Button1:SetTextColor( Color( 255, 255, 255 ) )
  263. Button1:SetPos( 55, pos - 35)
  264. Button1:SetSize( 425, 30 )
  265. Button1:SetFont( "Trebuchet18" )
  266. Button1.DoClick = function()
  267. RunConsoleCommand("DarkRP", "buyammo", item.ammoType)
  268. surface.PlaySound( "buttons/button9.wav" )
  269. F4Frame:Close()
  270. end
  271. Button1.Paint = function( self, w, h )
  272. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  273. end
  274.  
  275. local Icon = vgui.Create( "SpawnIcon", Button1 )
  276. Icon:SetSize( 30, 30 )
  277. Icon:SetPos( 0, 0 )
  278. Icon:SetModel( item.model )
  279. end
  280. end
  281. end
  282.  
  283. if(category == "Com") then
  284. print("Commands")
  285. local DNum1 = vgui.Create( "DNumberWang", DScrollPanel )
  286. DNum1:SetValue("100")
  287. DNum1:SetPos( 405, 0)
  288. DNum1:SetSize( 75, 30 )
  289. DNum1:SetFont( "Trebuchet18" )
  290.  
  291. local DNum2 = vgui.Create( "DNumberWang", DScrollPanel )
  292. DNum2:SetValue("100")
  293. DNum2:SetPos( 405, 35)
  294. DNum2:SetSize( 75, 30 )
  295. DNum2:SetFont( "Trebuchet18" )
  296.  
  297. local Button1 = vgui.Create( "DButton", DScrollPanel )
  298. Button1:SetText("Выбросить деньги")
  299. Button1:SetTextColor( Color( 255, 255, 255 ) )
  300. Button1:SetPos( 55, 0)
  301. Button1:SetSize( 350, 30 )
  302. Button1:SetFont( "Trebuchet18" )
  303. Button1.DoClick = function()
  304. RunConsoleCommand("DarkRP", "dropmoney", DNum1:GetValue())
  305. surface.PlaySound( "buttons/button9.wav" )
  306. F4Frame:Close()
  307. end
  308. Button1.Paint = function( self, w, h )
  309. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  310. end
  311.  
  312.  
  313. local Button2 = vgui.Create( "DButton", DScrollPanel )
  314. Button2:SetText("Передать деньги")
  315. Button2:SetTextColor( Color( 255, 255, 255 ) )
  316. Button2:SetPos( 55, 35)
  317. Button2:SetSize( 350, 30 )
  318. Button2:SetFont( "Trebuchet18" )
  319. Button2.DoClick = function()
  320. RunConsoleCommand("DarkRP", "give", DNum2:GetValue())
  321. surface.PlaySound( "buttons/button9.wav" )
  322. F4Frame:Close()
  323. end
  324. Button2.Paint = function( self, w, h )
  325. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  326. end
  327.  
  328. local Button3 = vgui.Create( "DButton", DScrollPanel )
  329. Button3:SetText("Запросить лицензию")
  330. Button3:SetTextColor( Color( 255, 255, 255 ) )
  331. Button3:SetPos( 55, 70)
  332. Button3:SetSize( 425, 30 )
  333. Button3:SetFont( "Trebuchet18" )
  334. Button3.DoClick = function()
  335. RunConsoleCommand("DarkRP", "requestlicense")
  336. surface.PlaySound( "buttons/button9.wav" )
  337. F4Frame:Close()
  338. end
  339. Button3.Paint = function( self, w, h )
  340. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  341. end
  342.  
  343. local Button4 = vgui.Create( "DButton", DScrollPanel )
  344. Button4:SetText("Обьявить Ком.Час")
  345. Button4:SetTextColor( Color( 255, 255, 255 ) )
  346. Button4:SetPos( 55, 105)
  347. Button4:SetSize( 425, 30 )
  348. Button4:SetFont( "Trebuchet18" )
  349. Button4.DoClick = function()
  350. RunConsoleCommand("DarkRP", "lockdown")
  351. surface.PlaySound( "buttons/button9.wav" )
  352. F4Frame:Close()
  353. end
  354. Button4.Paint = function( self, w, h )
  355. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  356. end
  357.  
  358. local Button5 = vgui.Create( "DButton", DScrollPanel )
  359. Button5:SetText("Выбросить оружие")
  360. Button5:SetTextColor( Color( 255, 255, 255 ) )
  361. Button5:SetPos( 55, 140)
  362. Button5:SetSize( 425, 30 )
  363. Button5:SetFont( "Trebuchet18" )
  364. Button5.DoClick = function()
  365. RunConsoleCommand("DarkRP", "drop")
  366. surface.PlaySound( "buttons/button9.wav" )
  367. F4Frame:Close()
  368. end
  369. Button5.Paint = function( self, w, h )
  370. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  371. end
  372.  
  373. local Button6 = vgui.Create( "DButton", DScrollPanel )
  374. Button6:SetText("Завершить Ком.Час")
  375. Button6:SetTextColor( Color( 255, 255, 255 ) )
  376. Button6:SetPos( 55, 175)
  377. Button6:SetSize( 425, 30 )
  378. Button6:SetFont( "Trebuchet18" )
  379. Button6.DoClick = function()
  380. RunConsoleCommand("DarkRP", "unlockdown")
  381. surface.PlaySound( "buttons/button9.wav" )
  382. F4Frame:Close()
  383. end
  384. Button6.Paint = function( self, w, h )
  385. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  386. end
  387.  
  388.  
  389. local TextEntry = vgui.Create( "DTextEntry", DScrollPanel ) -- create the form as a child of frame
  390. TextEntry:SetPos( 380, 210 )
  391. TextEntry:SetSize( 100, 30 )
  392. TextEntry:SetText( "Текст рекламы" )
  393.  
  394. local Button7 = vgui.Create( "DButton", DScrollPanel )
  395. Button7:SetText("Реклама")
  396. Button7:SetTextColor( Color( 255, 255, 255 ) )
  397. Button7:SetPos( 55, 210)
  398. Button7:SetSize( 325, 30 )
  399. Button7:SetFont( "Trebuchet18" )
  400. Button7.DoClick = function()
  401. RunConsoleCommand("say", "/ad " .. TextEntry:GetValue())
  402. surface.PlaySound( "buttons/button9.wav" )
  403. F4Frame:Close()
  404. end
  405. Button7.Paint = function( self, w, h )
  406. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  407. end
  408.  
  409.  
  410. local Button9 = vgui.Create( "DButton", DScrollPanel )
  411. Button9:SetText("Продать все двери")
  412. Button9:SetTextColor( Color( 255, 255, 255 ) )
  413. Button9:SetPos( 55, 245)
  414. Button9:SetSize( 425, 30 )
  415. Button9:SetFont( "Trebuchet18" )
  416. Button9.DoClick = function()
  417. RunConsoleCommand("darkrp", "sellalldoors")
  418. surface.PlaySound( "buttons/button9.wav" )
  419. F4Frame:Close()
  420. end
  421. Button9.Paint = function( self, w, h )
  422. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  423. end
  424.  
  425.  
  426. local NickEntry = vgui.Create( "DTextEntry", DScrollPanel ) -- create the form as a child of frame
  427. NickEntry:SetPos( 280, 280 )
  428. NickEntry:SetSize( 100, 30 )
  429. NickEntry:SetText( "Ник" )
  430.  
  431. local DemoteEntry = vgui.Create( "DTextEntry", DScrollPanel ) -- create the form as a child of frame
  432. DemoteEntry:SetPos( 380, 280 )
  433. DemoteEntry:SetSize( 100, 30 )
  434. DemoteEntry:SetText( "Причина" )
  435.  
  436. local Button10 = vgui.Create( "DButton", DScrollPanel )
  437. Button10:SetText("Уволить")
  438. Button10:SetTextColor( Color( 255, 255, 255 ) )
  439. Button10:SetPos( 55, 280)
  440. Button10:SetSize( 225, 30 )
  441. Button10:SetFont( "Trebuchet18" )
  442. Button10.DoClick = function()
  443. RunConsoleCommand("darkrp", "demote " .. NickEntry:GetValue() .. " " .. DemoteEntry:GetValue())
  444. surface.PlaySound( "buttons/button9.wav" )
  445. F4Frame:Close()
  446. end
  447. Button10.Paint = function( self, w, h )
  448. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  449. end
  450.  
  451.  
  452. local ONickEntry = vgui.Create( "DTextEntry", DScrollPanel ) -- create the form as a child of frame
  453. ONickEntry:SetPos( 280, 315 )
  454. ONickEntry:SetSize( 100, 30 )
  455. ONickEntry:SetText( "Ник" )
  456.  
  457. local ODemoteEntry = vgui.Create( "DTextEntry", DScrollPanel ) -- create the form as a child of frame
  458. ODemoteEntry:SetPos( 380, 315 )
  459. ODemoteEntry:SetSize( 100, 30 )
  460. ODemoteEntry:SetText( "Причина" )
  461.  
  462. local Button10 = vgui.Create( "DButton", DScrollPanel )
  463. Button10:SetText("Розыск")
  464. Button10:SetTextColor( Color( 255, 255, 255 ) )
  465. Button10:SetPos( 55, 315)
  466. Button10:SetSize( 225, 30 )
  467. Button10:SetFont( "Trebuchet18" )
  468. Button10.DoClick = function()
  469. RunConsoleCommand("say", "/wanted " .. ONickEntry:GetValue() .. " " .. ODemoteEntry:GetValue())
  470. surface.PlaySound( "buttons/button9.wav" )
  471. F4Frame:Close()
  472. end
  473. Button10.Paint = function( self, w, h )
  474. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  475. end
  476.  
  477.  
  478.  
  479.  
  480.  
  481. local O2NickEntry = vgui.Create( "DTextEntry", DScrollPanel ) -- create the form as a child of frame
  482. O2NickEntry:SetPos( 280, 350 )
  483. O2NickEntry:SetSize( 200, 30 )
  484. O2NickEntry:SetText( "Ник" )
  485.  
  486. local Button11 = vgui.Create( "DButton", DScrollPanel )
  487. Button11:SetText("Убрать Розыск")
  488. Button11:SetTextColor( Color( 255, 255, 255 ) )
  489. Button11:SetPos( 55, 350)
  490. Button11:SetSize( 225, 30 )
  491. Button11:SetFont( "Trebuchet18" )
  492. Button11.DoClick = function()
  493. RunConsoleCommand("say", "/unWanted " .. O2NickEntry:GetValue())
  494. surface.PlaySound( "buttons/button9.wav" )
  495. F4Frame:Close()
  496. end
  497. Button11.Paint = function( self, w, h )
  498. draw.RoundedBox( 0, 0, 0, w, h, Color( 64, 0, 0, 200 ) )
  499. end
  500. end
  501. end
  502.  
  503.  
  504. function CloseF4()
  505. F4Frame:Close()
  506. end
  507.  
  508. function RefreshUI()
  509. CloseF4()
  510. OpenF4()
  511. end
  512.  
  513. function GrabKey()
  514. if F4Frame and ValidPanel( F4Frame ) then
  515. CloseF4()
  516. else
  517. OpenF4()
  518. end
  519. end
  520. hook.Add("ShowSpare2", "OpenF4Menu", GrabKey)
Advertisement
Add Comment
Please, Sign In to add comment