Advertisement
Guest User

ClientSide VIPsystem Nexus decompiled

a guest
Oct 11th, 2017
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 25.17 KB | None | 0 0
  1. - Decompiled Client.luac
  2.  
  3.  
  4. Center = function(l_1_0)
  5.   local l_1_1, l_1_2 = guiGetScreenSize()
  6.   local l_1_3, l_1_4 = guiGetSize(l_1_0, false)
  7.   local l_1_5 = (l_1_1 - l_1_3) / 2
  8.   local l_1_6 = (l_1_2 - l_1_4) / 2
  9.   guiSetPosition(l_1_0, l_1_5, l_1_6, false)
  10. end
  11.  
  12. wCenter = function(l_2_0)
  13.   local l_2_1, l_2_2 = guiGetScreenSize()
  14.   local l_2_3, l_2_4 = guiGetSize(l_2_0, false)
  15.   local l_2_5 = (l_2_1 - l_2_3) / 2
  16.   local l_2_6 = (l_2_2 - l_2_4) / 2
  17.   guiSetPosition(l_2_0, l_2_5 + 300, l_2_6 - 136, false)
  18. end
  19.  
  20. tCenter = function(l_3_0)
  21.   local l_3_1, l_3_2 = guiGetScreenSize()
  22.   local l_3_3, l_3_4 = guiGetSize(l_3_0, false)
  23.   local l_3_5 = (l_3_1 - l_3_3) / 2
  24.   local l_3_6 = (l_3_2 - l_3_4) / 2
  25.   guiSetPosition(l_3_0, l_3_5 + 300, l_3_6 + 5, false)
  26. end
  27.  
  28. fsCenter = function(l_4_0)
  29.   local l_4_1, l_4_2 = guiGetScreenSize()
  30.   local l_4_3, l_4_4 = guiGetSize(l_4_0, false)
  31.   local l_4_5 = (l_4_1 - l_4_3) / 2
  32.   local l_4_6 = (l_4_2 - l_4_4) / 2
  33.   guiSetPosition(l_4_0, l_4_5 + 300, l_4_6 + 115, false)
  34. end
  35.  
  36. addEventHandler("onClientResourceStart", resourceRoot, function()
  37.   wnd = guiCreateWindow(330, 159, 361, 469, "VIP", false)
  38.   guiWindowSetMovable(wnd, false)
  39.   guiWindowSetSizable(wnd, false)
  40.   guiSetVisible(wnd, false)
  41.   Center(wnd)
  42.   guiSetProperty(wnd, "CaptionColour", "FFFFFF00")
  43.   vGrid = guiCreateGridList(10, 240, 182, 219, false, wnd)
  44.   guiGridListAddColumn(vGrid, "Vehicles list", 0.8)
  45.   addEventHandler("onClientGUIDoubleClick", vGrid, processDoubleClick, false)
  46.   populateGridlist()
  47.   vL1 = guiCreateLabel(11, 204, 345, 15, "_________________________________________________________________________", false, wnd)
  48.   guiSetFont(vL1, "default-bold-small")
  49.   guiLabelSetColor(vL1, 0, 0, 0)
  50.   vIMG = guiCreateStaticImage(11, 28, 167, 116, "VIP.png", false, wnd)
  51.   vL2 = guiCreateLabel(11, 170, 30, 15, "Name:", false, wnd)
  52.   guiSetFont(vL2, "default-small")
  53.   guiLabelSetColor(vL2, 255, 255, 0)
  54.   vL3 = guiCreateLabel(11, 189, 72, 15, "Subscribe Status:", false, wnd)
  55.   guiSetFont(vL3, "default-small")
  56.   guiLabelSetColor(vL3, 255, 255, 0)
  57.   vL4 = guiCreateLabel(11, 149, 114, 15, "Player Informations", false, wnd)
  58.   guiSetFont(vL4, "default-small")
  59.   guiLabelSetColor(vL4, 255, 0, 0)
  60.   vL5 = guiCreateLabel(11, 223, 49, 17, "Vehicles list", false, wnd)
  61.   guiSetFont(vL5, "default-small")
  62.   guiLabelSetColor(vL5, 255, 0, 0)
  63.   vL6 = guiCreateLabel(312, 449, 39, 15, "by Nexus", false, wnd)
  64.   guiSetFont(vL6, "default-small")
  65.   guiLabelSetColor(vL6, 255, 0, 0)
  66.   vL7 = guiCreateLabel(188, 28, 14, 181, "|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|", false, wnd)
  67.   guiSetFont(vL7, "default-small")
  68.   guiLabelSetColor(vL7, 0, 0, 0)
  69.   vL8 = guiCreateLabel(202, 240, 70, 15, "Vehicle Controls", false, wnd)
  70.   guiSetFont(vL8, "default-small")
  71.   guiLabelSetColor(vL8, 255, 0, 0)
  72.   bCreate = guiCreateButton(202, 265, 70, 20, "Create", false, wnd)
  73.   guiSetFont(bCreate, "default-bold-small")
  74.   guiSetProperty(bCreate, "HoverTextColour", "FFFFFF00")
  75.   guiSetProperty(bCreate, "NormalTextColour", "FFFFFF00")
  76.   addEventHandler("onClientGUIClick", bCreate, createVehicleHandler, false)
  77.   bSpawn = guiCreateButton(276, 265, 70, 20, "Spawn", false, wnd)
  78.   guiSetFont(bSpawn, "default-bold-small")
  79.   guiSetProperty(bSpawn, "HoverTextColour", "FFFFFF00")
  80.   guiSetProperty(bSpawn, "NormalTextColour", "FFFFFF00")
  81.   bWarp = guiCreateButton(202, 289, 70, 20, "Warp", false, wnd)
  82.   guiSetFont(bWarp, "default-bold-small")
  83.   guiSetProperty(bWarp, "HoverTextColour", "FFFFFF00")
  84.   guiSetProperty(bWarp, "NormalTextColour", "FFFFFF00")
  85.   bDestroy = guiCreateButton(276, 289, 70, 20, "Destroy", false, wnd)
  86.   guiSetFont(bDestroy, "default-bold-small")
  87.   guiSetProperty(bDestroy, "HoverTextColour", "FFFFFF00")
  88.   guiSetProperty(bDestroy, "NormalTextColour", "FFFFFF00")
  89.   vL9 = guiCreateLabel(202, 353, 145, 15, "_____________________________", false, wnd)
  90.   guiSetFont(vL9, "default-bold-small")
  91.   guiLabelSetColor(vL9, 0, 0, 0)
  92.   bEngine = guiCreateButton(202, 314, 70, 20, "Engine", false, wnd)
  93.   guiSetFont(bEngine, "default-bold-small")
  94.   guiSetProperty(bEngine, "HoverTextColour", "FFFFFF00")
  95.   guiSetProperty(bEngine, "NormalTextColour", "FFFFFF00")
  96.   bLights = guiCreateButton(276, 314, 70, 20, "Lights", false, wnd)
  97.   guiSetFont(bLights, "default-bold-small")
  98.   guiSetProperty(bLights, "HoverTextColour", "FFFFFF00")
  99.   guiSetProperty(bLights, "NormalTextColour", "FFFFFF00")
  100.   bLocks = guiCreateButton(202, 338, 144, 20, "Lock / Unlock", false, wnd)
  101.   guiSetFont(bLocks, "default-bold-small")
  102.   guiSetProperty(bLocks, "HoverTextColour", "FFFFFF00")
  103.   guiSetProperty(bLocks, "NormalTextColour", "FFFFFF00")
  104.   vL10 = guiCreateLabel(202, 373, 39, 15, "Additions", false, wnd)
  105.   guiSetFont(vL10, "default-small")
  106.   guiLabelSetColor(vL10, 255, 0, 0)
  107.   bColors = guiCreateButton(276, 398, 70, 20, "Colors", false, wnd)
  108.   guiSetFont(bColors, "default-bold-small")
  109.   guiSetProperty(bColors, "HoverTextColour", "FFFFFF00")
  110.   guiSetProperty(bColors, "NormalTextColour", "FFFFFF00")
  111.   bSmoke = guiCreateButton(202, 398, 70, 20, "Smoke", false, wnd)
  112.   guiSetFont(bSmoke, "default-bold-small")
  113.   guiSetProperty(bSmoke, "HoverTextColour", "FFFFFF00")
  114.   guiSetProperty(bSmoke, "NormalTextColour", "FFFFFF00")
  115.   bArrow = guiCreateButton(202, 424, 70, 20, "Arrow", false, wnd)
  116.   guiSetFont(bArrow, "default-bold-small")
  117.   guiSetProperty(bArrow, "HoverTextColour", "FFFFFF00")
  118.   guiSetProperty(bArrow, "NormalTextColour", "FFFFFF00")
  119.   bNitrous = guiCreateButton(276, 424, 70, 20, "Nitrous", false, wnd)
  120.   guiSetFont(bNitrous, "default-bold-small")
  121.   guiSetProperty(bNitrous, "HoverTextColour", "FFFFFF00")
  122.   guiSetProperty(bNitrous, "NormalTextColour", "FFFFFF00")
  123.   bCloseWnd = guiCreateButton(336, 23, 15, 15, "\195\151", false, wnd)
  124.   guiSetFont(bCloseWnd, "default-bold-small")
  125.   guiSetProperty(bCloseWnd, "HoverTextColour", "FFFF0000")
  126.   guiSetProperty(bCloseWnd, "NormalTextColour", "FFFF0000")
  127.   bSubscribe = guiCreateButton(276, 23, 60, 15, "Subscribe", false, wnd)
  128.   guiSetFont(bSubscribe, "default-small")
  129.   guiSetProperty(bSubscribe, "HoverTextColour", "FF00FF00")
  130.   guiSetProperty(bSubscribe, "NormalTextColour", "FF00FF00")
  131.   vL11 = guiCreateLabel(202, 48, 65, 15, "Player Controls", false, wnd)
  132.   guiSetFont(vL11, "default-small")
  133.   guiLabelSetColor(vL11, 255, 0, 0)
  134.   bStats = guiCreateButton(202, 73, 144, 20, "VIP Stats", false, wnd)
  135.   guiSetFont(bStats, "default-bold-small")
  136.   guiSetProperty(bStats, "HoverTextColour", "FFFFFF00")
  137.   guiSetProperty(bStats, "NormalTextColour", "FFFFFF00")
  138.   bFS = guiCreateButton(202, 148, 144, 20, "Fighting Style", false, wnd)
  139.   guiSetFont(bFS, "default-bold-small")
  140.   guiSetProperty(bFS, "HoverTextColour", "FFFFFF00")
  141.   guiSetProperty(bFS, "NormalTextColour", "FFFFFF00")
  142.   bHealth = guiCreateButton(202, 99, 70, 20, "Health", false, wnd)
  143.   guiSetFont(bHealth, "default-bold-small")
  144.   guiSetProperty(bHealth, "HoverTextColour", "FFFFFF00")
  145.   guiSetProperty(bHealth, "NormalTextColour", "FFFFFF00")
  146.   bArmor = guiCreateButton(276, 99, 70, 20, "Armor", false, wnd)
  147.   guiSetFont(bArmor, "default-bold-small")
  148.   guiSetProperty(bArmor, "HoverTextColour", "FFFFFF00")
  149.   guiSetProperty(bArmor, "NormalTextColour", "FFFFFF00")
  150.   bWeather = guiCreateButton(202, 124, 70, 20, "Weather", false, wnd)
  151.   guiSetFont(bWeather, "default-bold-small")
  152.   guiSetProperty(bWeather, "HoverTextColour", "FFFFFF00")
  153.   guiSetProperty(bWeather, "NormalTextColour", "FFFFFF00")
  154.   bTime = guiCreateButton(276, 124, 70, 20, "Time", false, wnd)
  155.   guiSetFont(bTime, "default-bold-small")
  156.   guiSetProperty(bTime, "HoverTextColour", "FFFFFF00")
  157.   guiSetProperty(bTime, "NormalTextColour", "FFFFFF00")
  158.   playerN = guiCreateLabel(40, 170, 113, 15, "N/A", false, wnd)
  159.   guiSetFont(playerN, "default-small")
  160.   guiLabelSetColor(playerN, 0, 255, 0)
  161.   playerS = guiCreateLabel(85, 189, 113, 15, "Not Active", false, wnd)
  162.   guiSetFont(playerS, "default-small")
  163.   guiLabelSetColor(playerS, 255, 0, 0)
  164.   wndWeather = guiCreateWindow(695, 159, 234, 197, "Weather", false)
  165.   guiWindowSetSizable(wndWeather, false)
  166.   guiSetVisible(wndWeather, false)
  167.   guiWindowSetMovable(wndWeather, false)
  168.   wCenter(wndWeather)
  169.   guiSetProperty(wndWeather, "CaptionColour", "FFFFFF00")
  170.   wL1 = guiCreateLabel(10, 32, 51, 15, "Set Weather", false, wndWeather)
  171.   guiSetFont(wL1, "default-small")
  172.   guiLabelSetColor(wL1, 255, 0, 0)
  173.   wb1 = guiCreateButton(9, 50, 215, 20, "Blue Skies / Clouds ", false, wndWeather)
  174.   guiSetFont(wb1, "default-bold-small")
  175.   guiSetProperty(wb1, "HoverTextColour", "FFFFFF00")
  176.   guiSetProperty(wb1, "NormalTextColour", "FFFFFF00")
  177.   wb2 = guiCreateButton(9, 98, 216, 20, "Cloudy and Foggy", false, wndWeather)
  178.   guiSetFont(wb2, "default-bold-small")
  179.   guiSetProperty(wb2, "HoverTextColour", "FFFFFF00")
  180.   guiSetProperty(wb2, "NormalTextColour", "FFFFFF00")
  181.   wb3 = guiCreateButton(9, 74, 108, 20, "Stormy", false, wndWeather)
  182.   guiSetFont(wb3, "default-bold-small")
  183.   guiSetProperty(wb3, "HoverTextColour", "FFFFFF00")
  184.   guiSetProperty(wb3, "NormalTextColour", "FFFFFF00")
  185.   wb4 = guiCreateButton(117, 74, 108, 20, "Scorching Hot", false, wndWeather)
  186.   guiSetFont(wb4, "default-bold-small")
  187.   guiSetProperty(wb4, "HoverTextColour", "FFFFFF00")
  188.   guiSetProperty(wb4, "NormalTextColour", "FFFFFF00")
  189.   wb5 = guiCreateButton(9, 122, 108, 20, "Sandstorm", false, wndWeather)
  190.   guiSetFont(wb5, "default-bold-small")
  191.   guiSetProperty(wb5, "HoverTextColour", "FFFFFF00")
  192.   guiSetProperty(wb5, "NormalTextColour", "FFFFFF00")
  193.   wb6 = guiCreateButton(117, 122, 108, 20, "Foggy", false, wndWeather)
  194.   guiSetFont(wb6, "default-bold-small")
  195.   guiSetProperty(wb6, "HoverTextColour", "FFFFFF00")
  196.   guiSetProperty(wb6, "NormalTextColour", "FFFFFF00")
  197.   wb7 = guiCreateButton(9, 146, 216, 20, "Very Dull, Colourless, Hazy ", false, wndWeather)
  198.   guiSetFont(wb7, "default-bold-small")
  199.   guiSetProperty(wb7, "HoverTextColour", "FFFFFF00")
  200.   guiSetProperty(wb7, "NormalTextColour", "FFFFFF00")
  201.   wb8 = guiCreateButton(9, 170, 216, 20, "Dull, Cloudy, Rainy", false, wndWeather)
  202.   guiSetFont(wb8, "default-bold-small")
  203.   guiSetProperty(wb8, "HoverTextColour", "FFFFFF00")
  204.   guiSetProperty(wb8, "NormalTextColour", "FFFFFF00")
  205.   wbClose = guiCreateButton(209, 21, 15, 15, "\195\151", false, wndWeather)
  206.   guiSetFont(wbClose, "default-bold-small")
  207.   guiSetProperty(wbClose, "HoverTextColour", "FFFF0000")
  208.   guiSetProperty(wbClose, "NormalTextColour", "FFFF0000")
  209.   wndTime = guiCreateWindow(695, 361, 234, 81, "Time", false)
  210.   guiWindowSetSizable(wndTime, false)
  211.   guiSetVisible(wndTime, false)
  212.   guiWindowSetMovable(wndTime, false)
  213.   tCenter(wndTime)
  214.   guiSetProperty(wndTime, "CaptionColour", "FFFFFF00")
  215.   tL1 = guiCreateLabel(10, 30, 41, 15, "Set Time", false, wndTime)
  216.   guiSetFont(tL1, "default-small")
  217.   guiLabelSetColor(tL1, 255, 0, 0)
  218.   Hours = guiCreateEdit(41, 49, 30, 22, "12", false, wndTime)
  219.   guiEditSetMaxLength(Hours, 2)
  220.   Minutes = guiCreateEdit(114, 49, 30, 22, "00", false, wndTime)
  221.   guiEditSetMaxLength(Minutes, 2)
  222.   tL2 = guiCreateLabel(10, 55, 27, 16, "Hours:", false, wndTime)
  223.   guiSetFont(tL2, "default-small")
  224.   guiLabelSetColor(tL2, 0, 255, 0)
  225.   tL3 = guiCreateLabel(76, 55, 34, 16, "Minutes:", false, wndTime)
  226.   guiSetFont(tL3, "default-small")
  227.   guiLabelSetColor(tL3, 0, 255, 0)
  228.   tbSetTime = guiCreateButton(154, 49, 70, 22, "Set", false, wndTime)
  229.   guiSetFont(tbSetTime, "default-bold-small")
  230.   guiSetProperty(tbSetTime, "HoverTextColour", "FFFFFF00")
  231.   guiSetProperty(tbSetTime, "NormalTextColour", "FFFFFF00")
  232.   tbClose = guiCreateButton(209, 24, 16, 15, "\195\151", false, wndTime)
  233.   guiSetFont(tbClose, "default-bold-small")
  234.   guiSetProperty(tbClose, "HoverTextColour", "FFFF0000")
  235.   guiSetProperty(tbClose, "NormalTextColour", "FFFF0000")
  236.   wndFStyle = guiCreateWindow(695, 447, 234, 134, "Fighting Style", false)
  237.   guiWindowSetSizable(wndFStyle, false)
  238.   guiSetVisible(wndFStyle, false)
  239.   guiWindowSetMovable(wndFStyle, false)
  240.   fsCenter(wndFStyle)
  241.   guiSetProperty(wndFStyle, "CaptionColour", "FFFFFF00")
  242.   fsL1 = guiCreateLabel(10, 35, 75, 15, "Set Fighting Style", false, wndFStyle)
  243.   guiSetFont(fsL1, "default-small")
  244.   guiLabelSetColor(fsL1, 255, 0, 0)
  245.   fsb1 = guiCreateButton(10, 56, 108, 20, "Standdard", false, wndFStyle)
  246.   guiSetFont(fsb1, "default-bold-small")
  247.   guiSetProperty(fsb1, "HoverTextColour", "FFFFFF00")
  248.   guiSetProperty(fsb1, "NormalTextColour", "FFFFFF00")
  249.   fsb2 = guiCreateButton(10, 80, 108, 20, "Kung Fu", false, wndFStyle)
  250.   guiSetFont(fsb2, "default-bold-small")
  251.   guiSetProperty(fsb2, "HoverTextColour", "FFFFFF00")
  252.   guiSetProperty(fsb2, "NormalTextColour", "FFFFFF00")
  253.   fsb3 = guiCreateButton(10, 104, 108, 20, "Grab Kick", false, wndFStyle)
  254.   guiSetFont(fsb3, "default-bold-small")
  255.   guiSetProperty(fsb3, "HoverTextColour", "FFFFFF00")
  256.   guiSetProperty(fsb3, "NormalTextColour", "FFFFFF00")
  257.   fsb4 = guiCreateButton(117, 56, 108, 20, "Boxing", false, wndFStyle)
  258.   guiSetFont(fsb4, "default-bold-small")
  259.   guiSetProperty(fsb4, "HoverTextColour", "FFFFFF00")
  260.   guiSetProperty(fsb4, "NormalTextColour", "FFFFFF00")
  261.   fsb5 = guiCreateButton(117, 80, 108, 20, "Knee Head", false, wndFStyle)
  262.   guiSetFont(fsb5, "default-bold-small")
  263.   guiSetProperty(fsb5, "HoverTextColour", "FFFFFF00")
  264.   guiSetProperty(fsb5, "NormalTextColour", "FFFFFF00")
  265.   fsb6 = guiCreateButton(117, 104, 108, 20, "Elbows", false, wndFStyle)
  266.   guiSetFont(fsb6, "default-bold-small")
  267.   guiSetProperty(fsb6, "HoverTextColour", "FFFFFF00")
  268.   guiSetProperty(fsb6, "NormalTextColour", "FFFFFF00")
  269.   fsbClose = guiCreateButton(209, 23, 15, 15, "\195\151", false, wndFStyle)
  270.   guiSetFont(fsbClose, "default-bold-small")
  271.   guiSetProperty(fsbClose, "HoverTextColour", "FFFF0000")
  272.   guiSetProperty(fsbClose, "NormalTextColour", "FFFF0000")
  273. end
  274. )
  275. addEventHandler("onClientGUIClick", root, function()
  276.   if source == bCloseWnd then
  277.     guiSetVisible(wnd, false)
  278.     guiSetVisible(wndWeather, false)
  279.     guiSetVisible(wndTime, false)
  280.     guiSetVisible(wndFStyle, false)
  281.     showCursor(false)
  282.   elseif source == bSpawn then
  283.     triggerServerEvent("Spawn", localPlayer)
  284.   elseif source == bWarp then
  285.     triggerServerEvent("Warp", localPlayer)
  286.   elseif source == bDestroy then
  287.     triggerServerEvent("Destroy", localPlayer)
  288.   elseif source == bArrow then
  289.     triggerServerEvent("Arrow", localPlayer)
  290.   elseif source == bColors then
  291.     triggerServerEvent("Colors", localPlayer)
  292.   elseif source == bSmoke then
  293.     triggerServerEvent("Smoke", localPlayer)
  294.   elseif source == bEngine then
  295.     triggerServerEvent("Engine", localPlayer)
  296.   elseif source == bLights then
  297.     triggerServerEvent("Lights", localPlayer)
  298.   elseif source == bLocks then
  299.     triggerServerEvent("Locks", localPlayer)
  300.   elseif source == bNitrous then
  301.     triggerServerEvent("Nitrous", localPlayer)
  302.   elseif source == bHealth then
  303.     triggerServerEvent("Health", localPlayer)
  304.   elseif source == bArmor then
  305.     triggerServerEvent("Armor", localPlayer)
  306.   elseif source == bStats then
  307.     triggerServerEvent("Stats", localPlayer)
  308.   elseif source == bWeather then
  309.     local l_6_0 = guiGetVisible(wndWeather)
  310.     guiSetVisible(wndWeather, not l_6_0)
  311.   elseif source == bTime then
  312.     local l_6_1 = guiGetVisible(wndTime)
  313.     guiSetVisible(wndTime, not l_6_1)
  314.   elseif source == bFS then
  315.     local l_6_2 = guiGetVisible(wndFStyle)
  316.     guiSetVisible(wndFStyle, not l_6_2)
  317.   elseif source == wb1 then
  318.     setWeather(math.random(0, 7))
  319.     outputChatBox("Weather has been set to Blue Skies / Clouds.", 0, 255, 0)
  320.   elseif source == wb2 then
  321.     setWeather(9)
  322.     outputChatBox("Weather has been set to Cloudy and Foggy.", 0, 255, 0)
  323.   elseif source == wb3 then
  324.     setWeather(8)
  325.     outputChatBox("Weather has been set to Stormy.", 0, 255, 0)
  326.   elseif source == wb4 then
  327.     setWeather(math.random(17, 18))
  328.     outputChatBox("Weather has been set to Scorching Hot.", 0, 255, 0)
  329.   elseif source == wb5 then
  330.     setWeather(19)
  331.     outputChatBox("Weather has been set to Sandstorm.", 0, 255, 0)
  332.   elseif source == wb6 then
  333.     setWeather(20)
  334.     outputChatBox("Weather has been set to Foggy.", 0, 255, 0)
  335.   elseif source == wb7 then
  336.     setWeather(math.random(12, 15))
  337.     outputChatBox("Weather has been set to Very Dull, Colourless, Hazy.", 0, 255, 0)
  338.   elseif source == wb8 then
  339.     setWeather(16)
  340.     outputChatBox("Weather has been set to Dull, Cloudy, Rainy.", 0, 255, 0)
  341.   elseif source == wbClose then
  342.     guiSetVisible(wndWeather, false)
  343.   elseif source == tbSetTime then
  344.     local l_6_3 = guiGetText(Hours)
  345.     local l_6_4 = guiGetText(Minutes)
  346.     if l_6_3 and l_6_4 then
  347.       setTime(l_6_3, l_6_4)
  348.       outputChatBox("Time changed successfully.", 0, 255, 0)
  349.     end
  350.   elseif source == tbClose then
  351.     guiSetVisible(wndTime, false)
  352.   elseif source == fsb1 then
  353.     triggerServerEvent("SetFStyle", localPlayer, 4)
  354.     outputChatBox("Fighting style has been set to Standard.", 0, 255, 0)
  355.   elseif source == fsb2 then
  356.     triggerServerEvent("SetFStyle", localPlayer, 6)
  357.     outputChatBox("Fighting style has been set to Kung Fu.", 0, 255, 0)
  358.   elseif source == fsb3 then
  359.     triggerServerEvent("SetFStyle", localPlayer, 16)
  360.     outputChatBox("Fighting style has been set to Grab Kick.", 0, 255, 0)
  361.   elseif source == fsb4 then
  362.     triggerServerEvent("SetFStyle", localPlayer, 5)
  363.     outputChatBox("Fighting style has been set to Boxing.", 0, 255, 0)
  364.   elseif source == fsb5 then
  365.     triggerServerEvent("SetFStyle", localPlayer, 7)
  366.     outputChatBox("Fighting style has been set to Knee Head.", 0, 255, 0)
  367.   elseif source == fsb6 then
  368.     triggerServerEvent("SetFStyle", localPlayer, 17)
  369.     outputChatBox("Fighting style has been set to Elbows.", 0, 255, 0)
  370.   elseif source == fsbClose then
  371.     guiSetVisible(wndFStyle, false)
  372.   end
  373. end
  374. )
  375. createVehicleHandler = function(l_7_0, l_7_1)
  376.   if l_7_0 == "left" and l_7_1 == "up" then
  377.     local l_7_2, l_7_3 = guiGridListGetSelectedItem(vGrid)
  378.     if l_7_2 and l_7_3 and l_7_2 ~= -1 and l_7_3 ~= -1 then
  379.       local l_7_4 = guiGridListGetItemData(vGrid, l_7_2, l_7_3)
  380.       l_7_4 = tonumber(l_7_4)
  381.       local l_7_5 = getLocalPlayer()
  382.       local l_7_6, l_7_7, l_7_8 = getElementPosition(l_7_5)
  383.       if l_7_4 and l_7_6 and l_7_7 and l_7_8 then
  384.         triggerServerEvent("createVehicleFromGUI", l_7_5, l_7_4, l_7_6, l_7_7, l_7_8)
  385.       else
  386.         outputChatBox("Invalid arguments.")
  387.       end
  388.     else
  389.       outputChatBox("Please select a vehicle.")
  390.     end
  391.   end
  392. end
  393.  
  394. populateGridlist = function()
  395.   local l_8_0 = xmlLoadFile("vehicles.xml")
  396.   if l_8_0 then
  397.     xmlUnloadFile(l_8_0)
  398.   end
  399. end
  400.  
  401. populateGridlist = function()
  402.   local l_9_0 = xmlLoadFile("vehicles.xml")
  403.   if l_9_0 then
  404.     for l_9_4,l_9_5 in ipairs(xmlNodeGetChildren(l_9_0)) do
  405.       local l_9_6 = guiGridListAddRow(vGrid)
  406.       local l_9_7 = xmlNodeGetAttribute(l_9_5, "type")
  407.       guiGridListSetItemText(vGrid, l_9_6, 1, l_9_7, true, false)
  408.       for l_9_11,l_9_12 in ipairs(xmlNodeGetChildren(l_9_5)) do
  409.         l_9_6 = guiGridListAddRow(vGrid)
  410.         l_9_7 = xmlNodeGetAttribute(l_9_12, "name")
  411.         local l_9_13 = xmlNodeGetAttribute(l_9_12, "id")
  412.         guiGridListSetItemText(vGrid, l_9_6, 1, l_9_7, false, false)
  413.         guiGridListSetItemText(vGrid, l_9_6, 2, getVehicleType(tonumber(l_9_13)), false, false)
  414.         guiGridListSetItemData(vGrid, l_9_6, 1, tostring(l_9_13))
  415.       end
  416.     end
  417.     xmlUnloadFile(l_9_0)
  418.   end
  419. end
  420.  
  421. processDoubleClick = function(l_10_0, l_10_1)
  422.   if l_10_0 == "left" and l_10_1 == "up" then
  423.     local l_10_2, l_10_3 = guiGridListGetSelectedItem(vGrid)
  424.     if l_10_2 and l_10_3 and l_10_2 ~= -1 and l_10_3 ~= -1 and guiGridListGetItemData(vGrid, l_10_2, l_10_3) == "header" then
  425.       local l_10_4 = guiGridListGetItemText(vGrid, l_10_2, l_10_3)
  426.       changeGridlistState(l_10_4)
  427.     end
  428.   end
  429. end
  430.  
  431. changeGridlistState = function(l_11_0)
  432.   if l_11_0 then
  433.     if getElementData(vGrid, "expanded") == l_11_0 then
  434.       guiGridListClear(vGrid)
  435.       for l_11_4,l_11_5 in pairs(vehicleTable) do
  436.         local l_11_6 = guiGridListAddRow(vGrid)
  437.         guiGridListSetItemText(vGrid, l_11_6, 1, l_11_4, false, false)
  438.         guiGridListSetItemData(vGrid, l_11_6, 1, "header")
  439.       end
  440.       setElementData(vGrid, "expanded", "none")
  441.     else
  442.       guiGridListClear(vGrid)
  443.       local l_11_7 = guiGridListAddRow(vGrid)
  444.       guiGridListSetItemText(vGrid, l_11_7, 1, l_11_0, false, false)
  445.       guiGridListSetItemData(vGrid, l_11_7, 1, "header")
  446.       for l_11_11,l_11_12 in ipairs(vehicleTable[l_11_0]) do
  447.         l_11_7 = guiGridListAddRow(vGrid)
  448.         guiGridListSetItemText(vGrid, l_11_7, 1, "- " .. l_11_12[2], false, false)
  449.         guiGridListSetItemData(vGrid, l_11_7, 1, tostring(l_11_12[1]))
  450.       end
  451.       setElementData(vGrid, "expanded", l_11_0)
  452.     end
  453.   end
  454. end
  455.  
  456. populateGridlist = function()
  457.   local l_12_0 = xmlLoadFile("vehicles.xml")
  458.   vehicleTable = {}
  459.   if l_12_0 then
  460.     for l_12_4,l_12_5 in ipairs(xmlNodeGetChildren(l_12_0)) do
  461.       local l_12_6 = guiGridListAddRow(vGrid)
  462.       local l_12_7 = xmlNodeGetAttribute(l_12_5, "type")
  463.       guiGridListSetItemText(vGrid, l_12_6, 1, l_12_7, false, false)
  464.       vehicleTable[l_12_7] = {}
  465.       guiGridListSetItemData(vGrid, l_12_6, 1, "header")
  466.       for l_12_11,l_12_12 in ipairs(xmlNodeGetChildren(l_12_5)) do
  467.         local l_12_13 = xmlNodeGetAttribute(l_12_12, "name")
  468.         local l_12_14 = xmlNodeGetAttribute(l_12_12, "id")
  469.         table.insert(vehicleTable[l_12_7], {l_12_14, l_12_13})
  470.       end
  471.     end
  472.     setElementData(vGrid, "expanded", "none")
  473.     xmlUnloadFile(l_12_0)
  474.   end
  475. end
  476.  
  477. open = function()
  478.   triggerServerEvent("showwindow", getLocalPlayer())
  479.   triggerServerEvent("status", getLocalPlayer())
  480. end
  481.  
  482. bindKey("Z", "down", open)
  483. vip = function()
  484.   if guiGetVisible(wnd) then
  485.     guiSetVisible(wnd, false)
  486.     guiSetVisible(wndWeather, false)
  487.     guiSetVisible(wndTime, false)
  488.     guiSetVisible(wndFStyle, false)
  489.     showCursor(false)
  490.   elseif not getElementData(localPlayer, "isBlocked") == true then
  491.     guiSetVisible(wnd, true)
  492.     showCursor(true)
  493.   end
  494. end
  495.  
  496. addEvent("showwindow", true)
  497. addEventHandler("showwindow", getRootElement(), vip)
  498. vip1 = function()
  499.   if guiGetVisible(playerS, true) then
  500.     guiSetText(playerS, "Active")
  501.     guiLabelSetColor(playerS, 0, 255, 0)
  502.     if guiGetEnabled(vGrid) == false and guiGetEnabled(bSpawn) == false and guiGetEnabled(bCreate) == false and guiGetEnabled(bWarp) == false and guiGetEnabled(bDestroy) == false and guiGetEnabled(bLights) == false and guiGetEnabled(bLocks) == false and guiGetEnabled(bEngine) == false and guiGetEnabled(bSmoke) == false and guiGetEnabled(bArrow) == false and guiGetEnabled(bColors) == false and guiGetEnabled(bNitrous) == false and guiGetEnabled(bStats) == false and guiGetEnabled(bArmor) == false and guiGetEnabled(bHealth) == false and guiGetEnabled(bWeather) == false and guiGetEnabled(bTime) == false and guiGetEnabled(bFS) == false then
  503.       guiSetEnabled(bSpawn, true)
  504.       guiSetEnabled(bCreate, true)
  505.       guiSetEnabled(bWarp, true)
  506.       guiSetEnabled(bDestroy, true)
  507.       guiSetEnabled(bLights, true)
  508.       guiSetEnabled(bLocks, true)
  509.       guiSetEnabled(vGrid, true)
  510.       guiSetEnabled(bEngine, true)
  511.       guiSetEnabled(bSmoke, true)
  512.       guiSetEnabled(bColors, true)
  513.       guiSetEnabled(bNitrous, true)
  514.       guiSetEnabled(bArrow, true)
  515.       guiSetEnabled(bStats, true)
  516.       guiSetEnabled(bHealth, true)
  517.       guiSetEnabled(bArmor, true)
  518.       guiSetEnabled(bWeather, true)
  519.       guiSetEnabled(bTime, true)
  520.       guiSetEnabled(bFS, true)
  521.     end
  522.   end
  523. end
  524.  
  525. addEvent("status", true)
  526. addEventHandler("status", getRootElement(), vip1)
  527. vip2 = function()
  528.   if guiGetVisible(playerS, true) then
  529.     guiSetText(playerS, "Not Active")
  530.     guiLabelSetColor(playerS, 255, 0, 0)
  531.     if guiGetEnabled(vGrid) == true and guiGetEnabled(bSpawn) == true and guiGetEnabled(bCreate) == true and guiGetEnabled(bWarp) == true and guiGetEnabled(bDestroy) == true and guiGetEnabled(bLights) == true and guiGetEnabled(bLocks) == true and guiGetEnabled(bEngine) == true and guiGetEnabled(bSmoke) == true and guiGetEnabled(bArrow) == true and guiGetEnabled(bColors) == true and guiGetEnabled(bNitrous) == true and guiGetEnabled(bStats) == true and guiGetEnabled(bArmor) == true and guiGetEnabled(bHealth) == true and guiGetEnabled(bWeather) == true and guiGetEnabled(bTime) == true and guiGetEnabled(bFS) == true then
  532.       guiSetEnabled(bSpawn, false)
  533.       guiSetEnabled(bCreate, false)
  534.       guiSetEnabled(bWarp, false)
  535.       guiSetEnabled(bDestroy, false)
  536.       guiSetEnabled(bLights, false)
  537.       guiSetEnabled(bLocks, false)
  538.       guiSetEnabled(vGrid, false)
  539.       guiSetEnabled(bEngine, false)
  540.       guiSetEnabled(bSmoke, false)
  541.       guiSetEnabled(bColors, false)
  542.       guiSetEnabled(bNitrous, false)
  543.       guiSetEnabled(bArrow, false)
  544.       guiSetEnabled(bStats, false)
  545.       guiSetEnabled(bHealth, false)
  546.       guiSetEnabled(bArmor, false)
  547.       guiSetEnabled(bWeather, false)
  548.       guiSetEnabled(bTime, false)
  549.       guiSetEnabled(bFS, false)
  550.     end
  551.   end
  552. end
  553.  
  554. addEvent("statusF", true)
  555. addEventHandler("statusF", getRootElement(), vip2)
  556. name = function()
  557.   if guiGetVisible(playerN, true) then
  558.     guiSetText(playerN, " " .. getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x", ""))
  559.   else
  560.     guiSetText(playerN, " N/A")
  561.   end
  562. end
  563.  
  564. addEventHandler("onClientRender", getRootElement(), name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement