Jump to content

Private VIP Panel...2 :p ?


Pedro001

Recommended Posts

Yaa! 

Guys, Nexus posted a decompiled version of his vip panel on the community himself, You can find the link on the comments section of the resource right here. https://community.multitheftauto.com/index.php?p=resources&s=comments&id=11136 thus I'm not stealing anything! 

But I wanted to ask for help on how to make this panel private, so that the panel will appear only for the ones in the acl group of Console. 

I've been trying to do it myself for almost a month now, but I just started learning Lua, and this will take so long for me to be able to do it. ?

I know I shouldn't ask someone to do it for me but, could someone at least give me as much simplified explanation as possible on how I can finally do it?  ?

 

ClientSide

- Decompiled Client.luac
 
 
Center = function(l_1_0)
  local l_1_1, l_1_2 = guiGetScreenSize()
  local l_1_3, l_1_4 = guiGetSize(l_1_0, false)
  local l_1_5 = (l_1_1 - l_1_3) / 2
  local l_1_6 = (l_1_2 - l_1_4) / 2
  guiSetPosition(l_1_0, l_1_5, l_1_6, false)
end
 
wCenter = function(l_2_0)
  local l_2_1, l_2_2 = guiGetScreenSize()
  local l_2_3, l_2_4 = guiGetSize(l_2_0, false)
  local l_2_5 = (l_2_1 - l_2_3) / 2
  local l_2_6 = (l_2_2 - l_2_4) / 2
  guiSetPosition(l_2_0, l_2_5 + 300, l_2_6 - 136, false)
end
 
tCenter = function(l_3_0)
  local l_3_1, l_3_2 = guiGetScreenSize()
  local l_3_3, l_3_4 = guiGetSize(l_3_0, false)
  local l_3_5 = (l_3_1 - l_3_3) / 2
  local l_3_6 = (l_3_2 - l_3_4) / 2
  guiSetPosition(l_3_0, l_3_5 + 300, l_3_6 + 5, false)
end
 
fsCenter = function(l_4_0)
  local l_4_1, l_4_2 = guiGetScreenSize()
  local l_4_3, l_4_4 = guiGetSize(l_4_0, false)
  local l_4_5 = (l_4_1 - l_4_3) / 2
  local l_4_6 = (l_4_2 - l_4_4) / 2
  guiSetPosition(l_4_0, l_4_5 + 300, l_4_6 + 115, false)
end
 
addEventHandler("onClientResourceStart", resourceRoot, function()
  wnd = guiCreateWindow(330, 159, 361, 469, "VIP", false)
  guiWindowSetMovable(wnd, false)
  guiWindowSetSizable(wnd, false)
  guiSetVisible(wnd, false)
  Center(wnd)
  guiSetProperty(wnd, "CaptionColour", "FFFFFF00")
  vGrid = guiCreateGridList(10, 240, 182, 219, false, wnd)
  guiGridListAddColumn(vGrid, "Vehicles list", 0.8)
  addEventHandler("onClientGUIDoubleClick", vGrid, processDoubleClick, false)
  populateGridlist()
  vL1 = guiCreateLabel(11, 204, 345, 15, "_________________________________________________________________________", false, wnd)
  guiSetFont(vL1, "default-bold-small")
  guiLabelSetColor(vL1, 0, 0, 0)
  vIMG = guiCreateStaticImage(11, 28, 167, 116, "VIP.png", false, wnd)
  vL2 = guiCreateLabel(11, 170, 30, 15, "Name:", false, wnd)
  guiSetFont(vL2, "default-small")
  guiLabelSetColor(vL2, 255, 255, 0)
  vL3 = guiCreateLabel(11, 189, 72, 15, "Subscribe Status:", false, wnd)
  guiSetFont(vL3, "default-small")
  guiLabelSetColor(vL3, 255, 255, 0)
  vL4 = guiCreateLabel(11, 149, 114, 15, "Player Informations", false, wnd)
  guiSetFont(vL4, "default-small")
  guiLabelSetColor(vL4, 255, 0, 0)
  vL5 = guiCreateLabel(11, 223, 49, 17, "Vehicles list", false, wnd)
  guiSetFont(vL5, "default-small")
  guiLabelSetColor(vL5, 255, 0, 0)
  vL6 = guiCreateLabel(312, 449, 39, 15, "by Nexus", false, wnd)
  guiSetFont(vL6, "default-small")
  guiLabelSetColor(vL6, 255, 0, 0)
  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)
  guiSetFont(vL7, "default-small")
  guiLabelSetColor(vL7, 0, 0, 0)
  vL8 = guiCreateLabel(202, 240, 70, 15, "Vehicle Controls", false, wnd)
  guiSetFont(vL8, "default-small")
  guiLabelSetColor(vL8, 255, 0, 0)
  bCreate = guiCreateButton(202, 265, 70, 20, "Create", false, wnd)
  guiSetFont(bCreate, "default-bold-small")
  guiSetProperty(bCreate, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bCreate, "NormalTextColour", "FFFFFF00")
  addEventHandler("onClientGUIClick", bCreate, createVehicleHandler, false)
  bSpawn = guiCreateButton(276, 265, 70, 20, "Spawn", false, wnd)
  guiSetFont(bSpawn, "default-bold-small")
  guiSetProperty(bSpawn, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bSpawn, "NormalTextColour", "FFFFFF00")
  bWarp = guiCreateButton(202, 289, 70, 20, "Warp", false, wnd)
  guiSetFont(bWarp, "default-bold-small")
  guiSetProperty(bWarp, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bWarp, "NormalTextColour", "FFFFFF00")
  bDestroy = guiCreateButton(276, 289, 70, 20, "Destroy", false, wnd)
  guiSetFont(bDestroy, "default-bold-small")
  guiSetProperty(bDestroy, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bDestroy, "NormalTextColour", "FFFFFF00")
  vL9 = guiCreateLabel(202, 353, 145, 15, "_____________________________", false, wnd)
  guiSetFont(vL9, "default-bold-small")
  guiLabelSetColor(vL9, 0, 0, 0)
  bEngine = guiCreateButton(202, 314, 70, 20, "Engine", false, wnd)
  guiSetFont(bEngine, "default-bold-small")
  guiSetProperty(bEngine, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bEngine, "NormalTextColour", "FFFFFF00")
  bLights = guiCreateButton(276, 314, 70, 20, "Lights", false, wnd)
  guiSetFont(bLights, "default-bold-small")
  guiSetProperty(bLights, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bLights, "NormalTextColour", "FFFFFF00")
  bLocks = guiCreateButton(202, 338, 144, 20, "Lock / Unlock", false, wnd)
  guiSetFont(bLocks, "default-bold-small")
  guiSetProperty(bLocks, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bLocks, "NormalTextColour", "FFFFFF00")
  vL10 = guiCreateLabel(202, 373, 39, 15, "Additions", false, wnd)
  guiSetFont(vL10, "default-small")
  guiLabelSetColor(vL10, 255, 0, 0)
  bColors = guiCreateButton(276, 398, 70, 20, "Colors", false, wnd)
  guiSetFont(bColors, "default-bold-small")
  guiSetProperty(bColors, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bColors, "NormalTextColour", "FFFFFF00")
  bSmoke = guiCreateButton(202, 398, 70, 20, "Smoke", false, wnd)
  guiSetFont(bSmoke, "default-bold-small")
  guiSetProperty(bSmoke, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bSmoke, "NormalTextColour", "FFFFFF00")
  bArrow = guiCreateButton(202, 424, 70, 20, "Arrow", false, wnd)
  guiSetFont(bArrow, "default-bold-small")
  guiSetProperty(bArrow, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bArrow, "NormalTextColour", "FFFFFF00")
  bNitrous = guiCreateButton(276, 424, 70, 20, "Nitrous", false, wnd)
  guiSetFont(bNitrous, "default-bold-small")
  guiSetProperty(bNitrous, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bNitrous, "NormalTextColour", "FFFFFF00")
  bCloseWnd = guiCreateButton(336, 23, 15, 15, "\195\151", false, wnd)
  guiSetFont(bCloseWnd, "default-bold-small")
  guiSetProperty(bCloseWnd, "HoverTextColour", "FFFF0000")
  guiSetProperty(bCloseWnd, "NormalTextColour", "FFFF0000")
  bSubscribe = guiCreateButton(276, 23, 60, 15, "Subscribe", false, wnd)
  guiSetFont(bSubscribe, "default-small")
  guiSetProperty(bSubscribe, "HoverTextColour", "FF00FF00")
  guiSetProperty(bSubscribe, "NormalTextColour", "FF00FF00")
  vL11 = guiCreateLabel(202, 48, 65, 15, "Player Controls", false, wnd)
  guiSetFont(vL11, "default-small")
  guiLabelSetColor(vL11, 255, 0, 0)
  bStats = guiCreateButton(202, 73, 144, 20, "VIP Stats", false, wnd)
  guiSetFont(bStats, "default-bold-small")
  guiSetProperty(bStats, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bStats, "NormalTextColour", "FFFFFF00")
  bFS = guiCreateButton(202, 148, 144, 20, "Fighting Style", false, wnd)
  guiSetFont(bFS, "default-bold-small")
  guiSetProperty(bFS, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bFS, "NormalTextColour", "FFFFFF00")
  bHealth = guiCreateButton(202, 99, 70, 20, "Health", false, wnd)
  guiSetFont(bHealth, "default-bold-small")
  guiSetProperty(bHealth, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bHealth, "NormalTextColour", "FFFFFF00")
  bArmor = guiCreateButton(276, 99, 70, 20, "Armor", false, wnd)
  guiSetFont(bArmor, "default-bold-small")
  guiSetProperty(bArmor, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bArmor, "NormalTextColour", "FFFFFF00")
  bWeather = guiCreateButton(202, 124, 70, 20, "Weather", false, wnd)
  guiSetFont(bWeather, "default-bold-small")
  guiSetProperty(bWeather, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bWeather, "NormalTextColour", "FFFFFF00")
  bTime = guiCreateButton(276, 124, 70, 20, "Time", false, wnd)
  guiSetFont(bTime, "default-bold-small")
  guiSetProperty(bTime, "HoverTextColour", "FFFFFF00")
  guiSetProperty(bTime, "NormalTextColour", "FFFFFF00")
  playerN = guiCreateLabel(40, 170, 113, 15, "N/A", false, wnd)
  guiSetFont(playerN, "default-small")
  guiLabelSetColor(playerN, 0, 255, 0)
  playerS = guiCreateLabel(85, 189, 113, 15, "Not Active", false, wnd)
  guiSetFont(playerS, "default-small")
  guiLabelSetColor(playerS, 255, 0, 0)
  wndWeather = guiCreateWindow(695, 159, 234, 197, "Weather", false)
  guiWindowSetSizable(wndWeather, false)
  guiSetVisible(wndWeather, false)
  guiWindowSetMovable(wndWeather, false)
  wCenter(wndWeather)
  guiSetProperty(wndWeather, "CaptionColour", "FFFFFF00")
  wL1 = guiCreateLabel(10, 32, 51, 15, "Set Weather", false, wndWeather)
  guiSetFont(wL1, "default-small")
  guiLabelSetColor(wL1, 255, 0, 0)
  wb1 = guiCreateButton(9, 50, 215, 20, "Blue Skies / Clouds ", false, wndWeather)
  guiSetFont(wb1, "default-bold-small")
  guiSetProperty(wb1, "HoverTextColour", "FFFFFF00")
  guiSetProperty(wb1, "NormalTextColour", "FFFFFF00")
  wb2 = guiCreateButton(9, 98, 216, 20, "Cloudy and Foggy", false, wndWeather)
  guiSetFont(wb2, "default-bold-small")
  guiSetProperty(wb2, "HoverTextColour", "FFFFFF00")
  guiSetProperty(wb2, "NormalTextColour", "FFFFFF00")
  wb3 = guiCreateButton(9, 74, 108, 20, "Stormy", false, wndWeather)
  guiSetFont(wb3, "default-bold-small")
  guiSetProperty(wb3, "HoverTextColour", "FFFFFF00")
  guiSetProperty(wb3, "NormalTextColour", "FFFFFF00")
  wb4 = guiCreateButton(117, 74, 108, 20, "Scorching Hot", false, wndWeather)
  guiSetFont(wb4, "default-bold-small")
  guiSetProperty(wb4, "HoverTextColour", "FFFFFF00")
  guiSetProperty(wb4, "NormalTextColour", "FFFFFF00")
  wb5 = guiCreateButton(9, 122, 108, 20, "Sandstorm", false, wndWeather)
  guiSetFont(wb5, "default-bold-small")
  guiSetProperty(wb5, "HoverTextColour", "FFFFFF00")
  guiSetProperty(wb5, "NormalTextColour", "FFFFFF00")
  wb6 = guiCreateButton(117, 122, 108, 20, "Foggy", false, wndWeather)
  guiSetFont(wb6, "default-bold-small")
  guiSetProperty(wb6, "HoverTextColour", "FFFFFF00")
  guiSetProperty(wb6, "NormalTextColour", "FFFFFF00")
  wb7 = guiCreateButton(9, 146, 216, 20, "Very Dull, Colourless, Hazy ", false, wndWeather)
  guiSetFont(wb7, "default-bold-small")
  guiSetProperty(wb7, "HoverTextColour", "FFFFFF00")
  guiSetProperty(wb7, "NormalTextColour", "FFFFFF00")
  wb8 = guiCreateButton(9, 170, 216, 20, "Dull, Cloudy, Rainy", false, wndWeather)
  guiSetFont(wb8, "default-bold-small")
  guiSetProperty(wb8, "HoverTextColour", "FFFFFF00")
  guiSetProperty(wb8, "NormalTextColour", "FFFFFF00")
  wbClose = guiCreateButton(209, 21, 15, 15, "\195\151", false, wndWeather)
  guiSetFont(wbClose, "default-bold-small")
  guiSetProperty(wbClose, "HoverTextColour", "FFFF0000")
  guiSetProperty(wbClose, "NormalTextColour", "FFFF0000")
  wndTime = guiCreateWindow(695, 361, 234, 81, "Time", false)
  guiWindowSetSizable(wndTime, false)
  guiSetVisible(wndTime, false)
  guiWindowSetMovable(wndTime, false)
  tCenter(wndTime)
  guiSetProperty(wndTime, "CaptionColour", "FFFFFF00")
  tL1 = guiCreateLabel(10, 30, 41, 15, "Set Time", false, wndTime)
  guiSetFont(tL1, "default-small")
  guiLabelSetColor(tL1, 255, 0, 0)
  Hours = guiCreateEdit(41, 49, 30, 22, "12", false, wndTime)
  guiEditSetMaxLength(Hours, 2)
  Minutes = guiCreateEdit(114, 49, 30, 22, "00", false, wndTime)
  guiEditSetMaxLength(Minutes, 2)
  tL2 = guiCreateLabel(10, 55, 27, 16, "Hours:", false, wndTime)
  guiSetFont(tL2, "default-small")
  guiLabelSetColor(tL2, 0, 255, 0)
  tL3 = guiCreateLabel(76, 55, 34, 16, "Minutes:", false, wndTime)
  guiSetFont(tL3, "default-small")
  guiLabelSetColor(tL3, 0, 255, 0)
  tbSetTime = guiCreateButton(154, 49, 70, 22, "Set", false, wndTime)
  guiSetFont(tbSetTime, "default-bold-small")
  guiSetProperty(tbSetTime, "HoverTextColour", "FFFFFF00")
  guiSetProperty(tbSetTime, "NormalTextColour", "FFFFFF00")
  tbClose = guiCreateButton(209, 24, 16, 15, "\195\151", false, wndTime)
  guiSetFont(tbClose, "default-bold-small")
  guiSetProperty(tbClose, "HoverTextColour", "FFFF0000")
  guiSetProperty(tbClose, "NormalTextColour", "FFFF0000")
  wndFStyle = guiCreateWindow(695, 447, 234, 134, "Fighting Style", false)
  guiWindowSetSizable(wndFStyle, false)
  guiSetVisible(wndFStyle, false)
  guiWindowSetMovable(wndFStyle, false)
  fsCenter(wndFStyle)
  guiSetProperty(wndFStyle, "CaptionColour", "FFFFFF00")
  fsL1 = guiCreateLabel(10, 35, 75, 15, "Set Fighting Style", false, wndFStyle)
  guiSetFont(fsL1, "default-small")
  guiLabelSetColor(fsL1, 255, 0, 0)
  fsb1 = guiCreateButton(10, 56, 108, 20, "Standdard", false, wndFStyle)
  guiSetFont(fsb1, "default-bold-small")
  guiSetProperty(fsb1, "HoverTextColour", "FFFFFF00")
  guiSetProperty(fsb1, "NormalTextColour", "FFFFFF00")
  fsb2 = guiCreateButton(10, 80, 108, 20, "Kung Fu", false, wndFStyle)
  guiSetFont(fsb2, "default-bold-small")
  guiSetProperty(fsb2, "HoverTextColour", "FFFFFF00")
  guiSetProperty(fsb2, "NormalTextColour", "FFFFFF00")
  fsb3 = guiCreateButton(10, 104, 108, 20, "Grab Kick", false, wndFStyle)
  guiSetFont(fsb3, "default-bold-small")
  guiSetProperty(fsb3, "HoverTextColour", "FFFFFF00")
  guiSetProperty(fsb3, "NormalTextColour", "FFFFFF00")
  fsb4 = guiCreateButton(117, 56, 108, 20, "Boxing", false, wndFStyle)
  guiSetFont(fsb4, "default-bold-small")
  guiSetProperty(fsb4, "HoverTextColour", "FFFFFF00")
  guiSetProperty(fsb4, "NormalTextColour", "FFFFFF00")
  fsb5 = guiCreateButton(117, 80, 108, 20, "Knee Head", false, wndFStyle)
  guiSetFont(fsb5, "default-bold-small")
  guiSetProperty(fsb5, "HoverTextColour", "FFFFFF00")
  guiSetProperty(fsb5, "NormalTextColour", "FFFFFF00")
  fsb6 = guiCreateButton(117, 104, 108, 20, "Elbows", false, wndFStyle)
  guiSetFont(fsb6, "default-bold-small")
  guiSetProperty(fsb6, "HoverTextColour", "FFFFFF00")
  guiSetProperty(fsb6, "NormalTextColour", "FFFFFF00")
  fsbClose = guiCreateButton(209, 23, 15, 15, "\195\151", false, wndFStyle)
  guiSetFont(fsbClose, "default-bold-small")
  guiSetProperty(fsbClose, "HoverTextColour", "FFFF0000")
  guiSetProperty(fsbClose, "NormalTextColour", "FFFF0000")
end
)
addEventHandler("onClientGUIClick", root, function()
  if source == bCloseWnd then
    guiSetVisible(wnd, false)
    guiSetVisible(wndWeather, false)
    guiSetVisible(wndTime, false)
    guiSetVisible(wndFStyle, false)
    showCursor(false)
  elseif source == bSpawn then
    triggerServerEvent("Spawn", localPlayer)
  elseif source == bWarp then
    triggerServerEvent("Warp", localPlayer)
  elseif source == bDestroy then
    triggerServerEvent("Destroy", localPlayer)
  elseif source == bArrow then
    triggerServerEvent("Arrow", localPlayer)
  elseif source == bColors then
    triggerServerEvent("Colors", localPlayer)
  elseif source == bSmoke then
    triggerServerEvent("Smoke", localPlayer)
  elseif source == bEngine then
    triggerServerEvent("Engine", localPlayer)
  elseif source == bLights then
    triggerServerEvent("Lights", localPlayer)
  elseif source == bLocks then
    triggerServerEvent("Locks", localPlayer)
  elseif source == bNitrous then
    triggerServerEvent("Nitrous", localPlayer)
  elseif source == bHealth then
    triggerServerEvent("Health", localPlayer)
  elseif source == bArmor then
    triggerServerEvent("Armor", localPlayer)
  elseif source == bStats then
    triggerServerEvent("Stats", localPlayer)
  elseif source == bWeather then
    local l_6_0 = guiGetVisible(wndWeather)
    guiSetVisible(wndWeather, not l_6_0)
  elseif source == bTime then
    local l_6_1 = guiGetVisible(wndTime)
    guiSetVisible(wndTime, not l_6_1)
  elseif source == bFS then
    local l_6_2 = guiGetVisible(wndFStyle)
    guiSetVisible(wndFStyle, not l_6_2)
  elseif source == wb1 then
    setWeather(math.random(0, 7))
    outputChatBox("Weather has been set to Blue Skies / Clouds.", 0, 255, 0)
  elseif source == wb2 then
    setWeather(9)
    outputChatBox("Weather has been set to Cloudy and Foggy.", 0, 255, 0)
  elseif source == wb3 then
    setWeather(8)
    outputChatBox("Weather has been set to Stormy.", 0, 255, 0)
  elseif source == wb4 then
    setWeather(math.random(17, 18))
    outputChatBox("Weather has been set to Scorching Hot.", 0, 255, 0)
  elseif source == wb5 then
    setWeather(19)
    outputChatBox("Weather has been set to Sandstorm.", 0, 255, 0)
  elseif source == wb6 then
    setWeather(20)
    outputChatBox("Weather has been set to Foggy.", 0, 255, 0)
  elseif source == wb7 then
    setWeather(math.random(12, 15))
    outputChatBox("Weather has been set to Very Dull, Colourless, Hazy.", 0, 255, 0)
  elseif source == wb8 then
    setWeather(16)
    outputChatBox("Weather has been set to Dull, Cloudy, Rainy.", 0, 255, 0)
  elseif source == wbClose then
    guiSetVisible(wndWeather, false)
  elseif source == tbSetTime then
    local l_6_3 = guiGetText(Hours)
    local l_6_4 = guiGetText(Minutes)
    if l_6_3 and l_6_4 then
      setTime(l_6_3, l_6_4)
      outputChatBox("Time changed successfully.", 0, 255, 0)
    end
  elseif source == tbClose then
    guiSetVisible(wndTime, false)
  elseif source == fsb1 then
    triggerServerEvent("SetFStyle", localPlayer, 4)
    outputChatBox("Fighting style has been set to Standard.", 0, 255, 0)
  elseif source == fsb2 then
    triggerServerEvent("SetFStyle", localPlayer, 6)
    outputChatBox("Fighting style has been set to Kung Fu.", 0, 255, 0)
  elseif source == fsb3 then
    triggerServerEvent("SetFStyle", localPlayer, 16)
    outputChatBox("Fighting style has been set to Grab Kick.", 0, 255, 0)
  elseif source == fsb4 then
    triggerServerEvent("SetFStyle", localPlayer, 5)
    outputChatBox("Fighting style has been set to Boxing.", 0, 255, 0)
  elseif source == fsb5 then
    triggerServerEvent("SetFStyle", localPlayer, 7)
    outputChatBox("Fighting style has been set to Knee Head.", 0, 255, 0)
  elseif source == fsb6 then
    triggerServerEvent("SetFStyle", localPlayer, 17)
    outputChatBox("Fighting style has been set to Elbows.", 0, 255, 0)
  elseif source == fsbClose then
    guiSetVisible(wndFStyle, false)
  end
end
)
createVehicleHandler = function(l_7_0, l_7_1)
  if l_7_0 == "left" and l_7_1 == "up" then
    local l_7_2, l_7_3 = guiGridListGetSelectedItem(vGrid)
    if l_7_2 and l_7_3 and l_7_2 ~= -1 and l_7_3 ~= -1 then
      local l_7_4 = guiGridListGetItemData(vGrid, l_7_2, l_7_3)
      l_7_4 = tonumber(l_7_4)
      local l_7_5 = getLocalPlayer()
      local l_7_6, l_7_7, l_7_8 = getElementPosition(l_7_5)
      if l_7_4 and l_7_6 and l_7_7 and l_7_8 then
        triggerServerEvent("createVehicleFromGUI", l_7_5, l_7_4, l_7_6, l_7_7, l_7_8)
      else
        outputChatBox("Invalid arguments.")
      end
    else
      outputChatBox("Please select a vehicle.")
    end
  end
end
 
populateGridlist = function()
  local l_8_0 = xmlLoadFile("vehicles.xml")
  if l_8_0 then
    xmlUnloadFile(l_8_0)
  end
end
 
populateGridlist = function()
  local l_9_0 = xmlLoadFile("vehicles.xml")
  if l_9_0 then
    for l_9_4,l_9_5 in ipairs(xmlNodeGetChildren(l_9_0)) do
      local l_9_6 = guiGridListAddRow(vGrid)
      local l_9_7 = xmlNodeGetAttribute(l_9_5, "type")
      guiGridListSetItemText(vGrid, l_9_6, 1, l_9_7, true, false)
      for l_9_11,l_9_12 in ipairs(xmlNodeGetChildren(l_9_5)) do
        l_9_6 = guiGridListAddRow(vGrid)
        l_9_7 = xmlNodeGetAttribute(l_9_12, "name")
        local l_9_13 = xmlNodeGetAttribute(l_9_12, "id")
        guiGridListSetItemText(vGrid, l_9_6, 1, l_9_7, false, false)
        guiGridListSetItemText(vGrid, l_9_6, 2, getVehicleType(tonumber(l_9_13)), false, false)
        guiGridListSetItemData(vGrid, l_9_6, 1, tostring(l_9_13))
      end
    end
    xmlUnloadFile(l_9_0)
  end
end
 
processDoubleClick = function(l_10_0, l_10_1)
  if l_10_0 == "left" and l_10_1 == "up" then
    local l_10_2, l_10_3 = guiGridListGetSelectedItem(vGrid)
    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
      local l_10_4 = guiGridListGetItemText(vGrid, l_10_2, l_10_3)
      changeGridlistState(l_10_4)
    end
  end
end
 
changeGridlistState = function(l_11_0)
  if l_11_0 then
    if getElementData(vGrid, "expanded") == l_11_0 then
      guiGridListClear(vGrid)
      for l_11_4,l_11_5 in pairs(vehicleTable) do
        local l_11_6 = guiGridListAddRow(vGrid)
        guiGridListSetItemText(vGrid, l_11_6, 1, l_11_4, false, false)
        guiGridListSetItemData(vGrid, l_11_6, 1, "header")
      end
      setElementData(vGrid, "expanded", "none")
    else
      guiGridListClear(vGrid)
      local l_11_7 = guiGridListAddRow(vGrid)
      guiGridListSetItemText(vGrid, l_11_7, 1, l_11_0, false, false)
      guiGridListSetItemData(vGrid, l_11_7, 1, "header")
      for l_11_11,l_11_12 in ipairs(vehicleTable[l_11_0]) do
        l_11_7 = guiGridListAddRow(vGrid)
        guiGridListSetItemText(vGrid, l_11_7, 1, "- " .. l_11_12[2], false, false)
        guiGridListSetItemData(vGrid, l_11_7, 1, tostring(l_11_12[1]))
      end
      setElementData(vGrid, "expanded", l_11_0)
    end
  end
end
 
populateGridlist = function()
  local l_12_0 = xmlLoadFile("vehicles.xml")
  vehicleTable = {}
  if l_12_0 then
    for l_12_4,l_12_5 in ipairs(xmlNodeGetChildren(l_12_0)) do
      local l_12_6 = guiGridListAddRow(vGrid)
      local l_12_7 = xmlNodeGetAttribute(l_12_5, "type")
      guiGridListSetItemText(vGrid, l_12_6, 1, l_12_7, false, false)
      vehicleTable[l_12_7] = {}
      guiGridListSetItemData(vGrid, l_12_6, 1, "header")
      for l_12_11,l_12_12 in ipairs(xmlNodeGetChildren(l_12_5)) do
        local l_12_13 = xmlNodeGetAttribute(l_12_12, "name")
        local l_12_14 = xmlNodeGetAttribute(l_12_12, "id")
        table.insert(vehicleTable[l_12_7], {l_12_14, l_12_13})
      end
    end
    setElementData(vGrid, "expanded", "none")
    xmlUnloadFile(l_12_0)
  end
end
 
open = function()
  triggerServerEvent("showwindow", getLocalPlayer())
  triggerServerEvent("status", getLocalPlayer())
end
 
bindKey("Z", "down", open)
vip = function()
  if guiGetVisible(wnd) then
    guiSetVisible(wnd, false)
    guiSetVisible(wndWeather, false)
    guiSetVisible(wndTime, false)
    guiSetVisible(wndFStyle, false)
    showCursor(false)
  elseif not getElementData(localPlayer, "isBlocked") == true then
    guiSetVisible(wnd, true)
    showCursor(true)
  end
end
 
addEvent("showwindow", true)
addEventHandler("showwindow", getRootElement(), vip)
vip1 = function()
  if guiGetVisible(playerS, true) then
    guiSetText(playerS, "Active")
    guiLabelSetColor(playerS, 0, 255, 0)
    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
      guiSetEnabled(bSpawn, true)
      guiSetEnabled(bCreate, true)
      guiSetEnabled(bWarp, true)
      guiSetEnabled(bDestroy, true)
      guiSetEnabled(bLights, true)
      guiSetEnabled(bLocks, true)
      guiSetEnabled(vGrid, true)
      guiSetEnabled(bEngine, true)
      guiSetEnabled(bSmoke, true)
      guiSetEnabled(bColors, true)
      guiSetEnabled(bNitrous, true)
      guiSetEnabled(bArrow, true)
      guiSetEnabled(bStats, true)
      guiSetEnabled(bHealth, true)
      guiSetEnabled(bArmor, true)
      guiSetEnabled(bWeather, true)
      guiSetEnabled(bTime, true)
      guiSetEnabled(bFS, true)
    end
  end
end
 
addEvent("status", true)
addEventHandler("status", getRootElement(), vip1)
vip2 = function()
  if guiGetVisible(playerS, true) then
    guiSetText(playerS, "Not Active")
    guiLabelSetColor(playerS, 255, 0, 0)
    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
      guiSetEnabled(bSpawn, false)
      guiSetEnabled(bCreate, false)
      guiSetEnabled(bWarp, false)
      guiSetEnabled(bDestroy, false)
      guiSetEnabled(bLights, false)
      guiSetEnabled(bLocks, false)
      guiSetEnabled(vGrid, false)
      guiSetEnabled(bEngine, false)
      guiSetEnabled(bSmoke, false)
      guiSetEnabled(bColors, false)
      guiSetEnabled(bNitrous, false)
      guiSetEnabled(bArrow, false)
      guiSetEnabled(bStats, false)
      guiSetEnabled(bHealth, false)
      guiSetEnabled(bArmor, false)
      guiSetEnabled(bWeather, false)
      guiSetEnabled(bTime, false)
      guiSetEnabled(bFS, false)
    end
  end
end
 
addEvent("statusF", true)
addEventHandler("statusF", getRootElement(), vip2)
name = function()
  if guiGetVisible(playerN, true) then
    guiSetText(playerN, " " .. getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x", ""))
  else
    guiSetText(playerN, " N/A")
  end
end
 
addEventHandler("onClientRender", getRootElement(), name)

 

ServerSide

- Decompiled Server.luac
 
local l_0_0 = {}
local l_0_1 = {}
local l_0_2 = {}
local l_0_3 = {}
local l_0_4 = {}
local l_0_5 = {}
 
addEventHandler("onPlayerQuit", root, function()
  if isElement(source) and getElementData(source, "isOwner") ~= nil and getElementType(getElementData(source, "isOwner")) == "vehicle" then
    destroyElement(getElementData(source, "isOwner"))
    removeElementData(source, "isOwner")
    if isTimer(l_0_0[source]) then
      killTimer(l_0_0[source])
    end
    if isTimer(l_0_1[source]) then
      killTimer(l_0_1[source])
    end
    if isElement(l_0_4[source]) then
      destroyElement(l_0_4[source])
      l_0_4[source] = nil
    end
    if isElement(l_0_5[source]) then
      destroyElement(l_0_5[source])
      l_0_5[source] = nil
    end
  end
end
)
createMyVehicle = function(l_2_0, l_2_1, l_2_2, l_2_3)
  if l_2_0 and l_2_1 and l_2_2 and l_2_3 and not isGuestAccount(getPlayerAccount(source)) and getElementData(source, "isOwner") == nil then
    local l_2_4 = getPlayerAccount(source)
    local l_2_5 = getAccountName(l_2_4)
    local l_2_6 = getPlayerName(source)
    local l_2_7 = l_2_6:gsub("#%x%x%x%x%x%x", "")
    theVehicle = createVehicle(l_2_0, l_2_1 + 2, l_2_2 + 2, l_2_3)
    setVehicleDamageProof(theVehicle, true)
    setElementData(source, "isOwner", theVehicle)
    setElementData(theVehicle, "Owner", l_2_5)
    setElementData(theVehicle, "OwnerName", l_2_7)
    setElementData(theVehicle, "Locked", true)
    return
  end
  if l_2_0 and l_2_1 and l_2_2 and l_2_3 then
    local l_2_8 = getPedOccupiedVehicle(source)
    local l_2_9 = getElementData(source, "isOwner")
    if isPedInVehicle(source) and isElement(l_2_8) and isElement(l_2_9) and l_2_8 == l_2_9 then
      setElementModel(l_2_9, l_2_0)
      return
    end
  end
  if l_2_0 and l_2_1 and l_2_2 and l_2_3 and not isGuestAccount(getPlayerAccount(source)) and getElementData(source, "isOwner") ~= nil then
    local l_2_10 = getPlayerAccount(source)
    local l_2_11 = getAccountName(l_2_10)
    local l_2_12 = getPlayerName(source):gsub("#%x%x%x%x%x%x", "")
    if isElement(getElementData(source, "isOwner")) then
      destroyElement(getElementData(source, "isOwner"))
    end
    removeElementData(source, "isOwner")
    theVehicle = createVehicle(l_2_0, l_2_1 + 2, l_2_2 + 2, l_2_3)
    setVehicleDamageProof(theVehicle, true)
    setElementData(source, "isOwner", theVehicle, true)
    setElementData(theVehicle, "Owner", l_2_11)
    setElementData(theVehicle, "OwnerName", l_2_12)
    setElementData(theVehicle, "Locked", true)
  end
end
 
addEvent("createVehicleFromGUI", true)
addEventHandler("createVehicleFromGUI", root, createMyVehicle)
addEventHandler("onVehicleStartEnter", root, function(l_3_0)
  local l_3_1 = getElementData(source, "Owner")
  local l_3_2 = getElementData(source, "Locked")
  if l_3_1 and l_3_2 then
    local l_3_3 = getPlayerAccount(l_3_0)
    if getAccountName(l_3_3) ~= getElementData(source, "Owner") then
      cancelEvent()
      b = math.random(0, 255)
      g = math.random(0, 255)
      r = math.random(0, 255)
      outputChatBox(" *[ Private car owned by " .. getElementData(source, "OwnerName") .. " ]", l_3_0, r, g, b, true)
    else
      b = math.random(0, 255)
      g = math.random(0, 255)
      r = math.random(0, 255)
      outputChatBox(" *[ Welcome \226\152\186 ]", l_3_0, r, b, g, true)
    end
  end
end
)
addEvent("Spawn", true)
addEventHandler("Spawn", root, function()
  local l_4_0, l_4_1, l_4_2 = getElementPosition(source)
  local l_4_3 = getElementData(source, "isOwner")
  if not isElement(l_4_3) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_4_3 and isElement(l_4_3) then
    setElementPosition(getElementData(source, "isOwner"), l_4_0 + 2, l_4_1, l_4_2 + 1)
    outputChatBox(" *Car Spawned.", source, 255, 0, 0)
  end
end
)
addEvent("Warp", true)
addEventHandler("Warp", root, function()
  local l_5_0 = getElementData(source, "isOwner")
  if not isElement(l_5_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_5_0 and isElement(l_5_0) then
    fadeCamera(source, false, 0.5)
    setTimer(fadeCamera, 500, 1, source, true)
    warpPedIntoVehicle(source, l_5_0)
  end
end
)
addEvent("Destroy", true)
addEventHandler("Destroy", root, function()
  local l_6_0 = getElementData(source, "isOwner")
  if not isElement(l_6_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_6_0 and isElement(l_6_0) then
    destroyElement(l_6_0)
    outputChatBox(" *Car Destroyed.", source, 255, 0, 0)
    removeElementData(source, "isOwner")
    if isElement(l_0_5[source]) then
      destroyElement(l_0_5[source])
      l_0_5[source] = nil
    end
    if isElement(l_0_4[source]) then
      destroyElement(l_0_4[source])
      l_0_4[source] = nil
    end
  end
end
)
addEvent("Locks", true)
addEventHandler("Locks", root, function()
  local l_7_0 = getElementData(source, "isOwner")
  if not isElement(l_7_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_7_0 and isElement(l_7_0) then
    local l_7_1 = getElementData(l_7_0, "Locked")
    if l_7_1 == true then
      removeElementData(l_7_0, "Locked")
      outputChatBox(" *Car unlocked.", source, 255, 0, 0)
    else
      setElementData(l_7_0, "Locked", true)
      outputChatBox(" *Car locked.", source, 0, 255, 0)
    end
  end
end
)
addEvent("Engine", true)
addEventHandler("Engine", root, function()
  local l_8_0 = getElementData(source, "isOwner")
  if not isElement(l_8_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_8_0 and isElement(l_8_0) then
    local l_8_1 = getVehicleEngineState(l_8_0)
    if not l_8_1 then
      setVehicleEngineState(l_8_0, not l_8_1)
      outputChatBox(" *Engine started.", source, 0, 255, 0)
    else
      setVehicleEngineState(l_8_0, not l_8_1)
      outputChatBox(" *Engine stopped.", source, 255, 0, 0)
    end
  end
end
)
addEvent("Lights", true)
addEventHandler("Lights", root, function()
  local l_9_0 = getElementData(source, "isOwner")
  if not isElement(l_9_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_9_0 and isElement(l_9_0) then
    local l_9_1 = getVehicleOverrideLights(l_9_0) == 2
    if not l_9_1 then
      setVehicleOverrideLights(l_9_0, 2)
      outputChatBox(" *Lights On.", source, 0, 255, 0)
    else
      setVehicleOverrideLights(l_9_0, 1)
      outputChatBox(" *Lights Off.", source, 255, 0, 0)
    end
  end
end
)
addEvent("Nitrous", true)
addEventHandler("Nitrous", root, function()
  local l_10_0 = getElementData(source, "isOwner")
  if not isElement(l_10_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_10_0 and isElement(l_10_0) then
    addVehicleUpgrade(l_10_0, 1010)
    outputChatBox(" *Nitrous upgrade has been added to your vehicle.", source, 0, 255, 0)
  end
end
)
addEvent("Arrow", true)
addEventHandler("Arrow", root, function()
  local l_11_0 = getElementData(source, "isOwner")
  if not isElement(l_11_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_11_0 and isElement(l_11_0) then
    if isElement(l_0_5[source]) then
      destroyElement(l_0_5[source])
      outputChatBox(" *The arrow has been removed from your vehicle.", source, 255, 0, 0)
    else
      local l_11_1, l_11_2, l_11_3 = getElementPosition(l_11_0)
      l_0_5[source] = createObject(1318, l_11_1, l_11_2, l_11_3 + 2, 0, 0, 0)
      attachElements(l_0_5[source], l_11_0, 0, 0, 2)
      outputChatBox(" *The arrow has been attached to your vehicle.", source, 0, 255, 0)
    end
  end
end
)
addEvent("Colors", true)
addEventHandler("Colors", root, function()
  local l_12_0 = getElementData(source, "isOwner")
  if not isElement(l_12_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_12_0 and isElement(l_12_0) then
    if not l_0_2[source] then
      l_0_2[source] = true
      l_0_0[source] = setTimer(randomVehColors, 1000, 0, l_12_0, source)
      outputChatBox(" *Random colors is now enabled.", source, 0, 255, 0)
    else
      l_0_2[source] = false
      if isTimer(l_0_0[source]) then
        killTimer(l_0_0[source])
        outputChatBox(" *Random colors is now disabled", source, 255, 0, 0)
      end
    end
  end
end
)
randomVehColors = function(l_13_0, l_13_1)
  if not isElement(l_13_0) and isElement(l_13_1) then
    if isTimer(l_0_0[l_13_1]) then
      killTimer(l_0_0[l_13_1])
    end
    l_0_2[l_13_1] = false
    return
  end
  if isElement(l_13_0) then
    local l_13_2 = math.random(0, 255)
    local l_13_3 = math.random(0, 255)
    local l_13_4 = math.random(0, 255)
    local l_13_5 = math.random(0, 255)
    setVehicleColor(l_13_0, l_13_2, l_13_3, l_13_4, l_13_5)
  end
end
 
addEvent("Smoke", true)
addEventHandler("Smoke", root, function()
  local l_14_0 = getElementData(source, "isOwner")
  if not isElement(l_14_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_14_0 and isElement(l_14_0) and l_0_3[source] then
    l_0_3[source] = false
    if isTimer(l_0_1[source]) then
      killTimer(l_0_1[source])
    end
    if isElement(l_0_4[source]) then
      destroyElement(l_0_4[source])
      l_0_4[source] = nil
    end
    outputChatBox(" *Smoke is now disabled.", source, 255, 0, 0)
    return
  end
  if l_14_0 and isElement(l_14_0) and not l_0_3[source] then
    l_0_3[source] = true
    l_0_1[source] = setTimer(addSmoke, 1000, 0, l_14_0, source)
    outputChatBox(" *Smoke is now enabled.", source, 0, 255, 0)
  end
end
)
addSmoke = function(l_15_0, l_15_1)
  if not isElement(l_15_0) and isElement(l_15_1) then
    if isTimer(l_0_1[l_15_1]) then
      killTimer(l_0_1[l_15_1])
    end
    if isElement(l_0_4[l_15_1]) then
      destroyElement(l_0_4[l_15_1])
      l_0_4[l_15_1] = nil
    end
    l_0_3[l_15_1] = false
    return
  end
  local l_15_2 = getElementSpeed(l_15_0, "kmh")
  if l_15_2 >= 120 then
    local l_15_3, l_15_4, l_15_5 = getElementPosition(l_15_0)
    if isElement(l_0_4[l_15_1]) then
      return
    end
    l_0_4[l_15_1] = createObject(2780, l_15_3, l_15_4, l_15_5 - 2, 0, 0, 0)
    setElementAlpha(l_0_4[l_15_1], 0)
    attachElements(l_0_4[l_15_1], l_15_0, 0, -2, -1)
  elseif isElement(l_0_4[l_15_1]) then
    destroyElement(l_0_4[l_15_1])
    l_0_4[l_15_1] = nil
  end
end
 
addEvent("Armor", true)
addEventHandler("Armor", root, function()
  if isElement(source) then
    setPedArmor(source, 100)
    outputChatBox("Your armor has been set to 100%.", source, 0, 255, 0)
  end
end
)
addEvent("Health", true)
addEventHandler("Health", root, function()
  if isElement(source) then
    setElementHealth(source, 200)
    outputChatBox("Your health has been set to 100%.", source, 0, 255, 0)
  end
end
)
addEvent("SetFStyle", true)
addEventHandler("SetFStyle", root, function(l_18_0)
  if isElement(source) and tonumber(l_18_0) then
    setPedFightingStyle(source, tonumber(l_18_0))
  end
end
)
addEvent("Stats", true)
addEventHandler("Stats", root, function()
  if isElement(source) then
    setPedStat(source, 23, 1000)
    setPedStat(source, 24, 1000)
    setPedStat(source, 69, 1000)
    setPedStat(source, 70, 1000)
    setPedStat(source, 71, 1000)
    setPedStat(source, 72, 1000)
    setPedStat(source, 73, 1000)
    setPedStat(source, 74, 1000)
    setPedStat(source, 75, 1000)
    setPedStat(source, 76, 1000)
    setPedStat(source, 77, 1000)
    setPedStat(source, 78, 1000)
    setPedStat(source, 79, 1000)
    outputChatBox("Your weapon skills and max health has been set to maximum.", source, 0, 255, 0)
  end
end
)
getElementSpeed = function(l_20_0, l_20_1)
  if l_20_1 == nil then
    l_20_1 = 0
  end
  if isElement(l_20_0) then
    local l_20_2, l_20_3, l_20_4 = getElementVelocity(l_20_0)
    if l_20_1 == "mph" or l_20_1 == 1 or l_20_1 == "1" then
      return l_20_2 ^ 2 + l_20_3 ^ 2 + l_20_4 ^ 2 ^ 0.5 * 100
    else
      return l_20_2 ^ 2 + l_20_3 ^ 2 + l_20_4 ^ 2 ^ 0.5 * 1.61 * 100
    end
  else
    outputDebugString("Not an element. Can't get speed")
    return false
  end
end
 
addEvent("status", true)
addEventHandler("status", root, function()
  local l_21_0 = getPlayerAccount(source)
  local l_21_1 = getAccountName(l_21_0)
  if isObjectInACLGroup("user." .. l_21_1, aclGetGroup("VIP")) then
    triggerClientEvent(source, "status", source)
  else
    triggerClientEvent(source, "statusF", source)
  end
end
)
open = function()
  triggerClientEvent(source, "showwindow", source)
end
 
addEvent("showwindow", true)
addEventHandler("showwindow", getRootElement(), open)

 

Link to comment
- Decompiled Server.luac
 
local l_0_0 = {}
local l_0_1 = {}
local l_0_2 = {}
local l_0_3 = {}
local l_0_4 = {}
local l_0_5 = {}
 
addEventHandler("onPlayerQuit", root, function()
  if isElement(source) and getElementData(source, "isOwner") ~= nil and getElementType(getElementData(source, "isOwner")) == "vehicle" then
    destroyElement(getElementData(source, "isOwner"))
    removeElementData(source, "isOwner")
    if isTimer(l_0_0[source]) then
      killTimer(l_0_0[source])
    end
    if isTimer(l_0_1[source]) then
      killTimer(l_0_1[source])
    end
    if isElement(l_0_4[source]) then
      destroyElement(l_0_4[source])
      l_0_4[source] = nil
    end
    if isElement(l_0_5[source]) then
      destroyElement(l_0_5[source])
      l_0_5[source] = nil
    end
  end
end
)
createMyVehicle = function(l_2_0, l_2_1, l_2_2, l_2_3)
  if l_2_0 and l_2_1 and l_2_2 and l_2_3 and not isGuestAccount(getPlayerAccount(source)) and getElementData(source, "isOwner") == nil then
    local l_2_4 = getPlayerAccount(source)
    local l_2_5 = getAccountName(l_2_4)
    local l_2_6 = getPlayerName(source)
    local l_2_7 = l_2_6:gsub("#%x%x%x%x%x%x", "")
    theVehicle = createVehicle(l_2_0, l_2_1 + 2, l_2_2 + 2, l_2_3)
    setVehicleDamageProof(theVehicle, true)
    setElementData(source, "isOwner", theVehicle)
    setElementData(theVehicle, "Owner", l_2_5)
    setElementData(theVehicle, "OwnerName", l_2_7)
    setElementData(theVehicle, "Locked", true)
    return
  end
  if l_2_0 and l_2_1 and l_2_2 and l_2_3 then
    local l_2_8 = getPedOccupiedVehicle(source)
    local l_2_9 = getElementData(source, "isOwner")
    if isPedInVehicle(source) and isElement(l_2_8) and isElement(l_2_9) and l_2_8 == l_2_9 then
      setElementModel(l_2_9, l_2_0)
      return
    end
  end
  if l_2_0 and l_2_1 and l_2_2 and l_2_3 and not isGuestAccount(getPlayerAccount(source)) and getElementData(source, "isOwner") ~= nil then
    local l_2_10 = getPlayerAccount(source)
    local l_2_11 = getAccountName(l_2_10)
    local l_2_12 = getPlayerName(source):gsub("#%x%x%x%x%x%x", "")
    if isElement(getElementData(source, "isOwner")) then
      destroyElement(getElementData(source, "isOwner"))
    end
    removeElementData(source, "isOwner")
    theVehicle = createVehicle(l_2_0, l_2_1 + 2, l_2_2 + 2, l_2_3)
    setVehicleDamageProof(theVehicle, true)
    setElementData(source, "isOwner", theVehicle, true)
    setElementData(theVehicle, "Owner", l_2_11)
    setElementData(theVehicle, "OwnerName", l_2_12)
    setElementData(theVehicle, "Locked", true)
  end
end
 
addEvent("createVehicleFromGUI", true)
addEventHandler("createVehicleFromGUI", root, createMyVehicle)
addEventHandler("onVehicleStartEnter", root, function(l_3_0)
  local l_3_1 = getElementData(source, "Owner")
  local l_3_2 = getElementData(source, "Locked")
  if l_3_1 and l_3_2 then
    local l_3_3 = getPlayerAccount(l_3_0)
    if getAccountName(l_3_3) ~= getElementData(source, "Owner") then
      cancelEvent()
      b = math.random(0, 255)
      g = math.random(0, 255)
      r = math.random(0, 255)
      outputChatBox(" *[ Private car owned by " .. getElementData(source, "OwnerName") .. " ]", l_3_0, r, g, b, true)
    else
      b = math.random(0, 255)
      g = math.random(0, 255)
      r = math.random(0, 255)
      outputChatBox(" *[ Welcome \226\152\186 ]", l_3_0, r, b, g, true)
    end
  end
end
)
addEvent("Spawn", true)
addEventHandler("Spawn", root, function()
  local l_4_0, l_4_1, l_4_2 = getElementPosition(source)
  local l_4_3 = getElementData(source, "isOwner")
  if not isElement(l_4_3) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_4_3 and isElement(l_4_3) then
    setElementPosition(getElementData(source, "isOwner"), l_4_0 + 2, l_4_1, l_4_2 + 1)
    outputChatBox(" *Car Spawned.", source, 255, 0, 0)
  end
end
)
addEvent("Warp", true)
addEventHandler("Warp", root, function()
  local l_5_0 = getElementData(source, "isOwner")
  if not isElement(l_5_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_5_0 and isElement(l_5_0) then
    fadeCamera(source, false, 0.5)
    setTimer(fadeCamera, 500, 1, source, true)
    warpPedIntoVehicle(source, l_5_0)
  end
end
)
addEvent("Destroy", true)
addEventHandler("Destroy", root, function()
  local l_6_0 = getElementData(source, "isOwner")
  if not isElement(l_6_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_6_0 and isElement(l_6_0) then
    destroyElement(l_6_0)
    outputChatBox(" *Car Destroyed.", source, 255, 0, 0)
    removeElementData(source, "isOwner")
    if isElement(l_0_5[source]) then
      destroyElement(l_0_5[source])
      l_0_5[source] = nil
    end
    if isElement(l_0_4[source]) then
      destroyElement(l_0_4[source])
      l_0_4[source] = nil
    end
  end
end
)
addEvent("Locks", true)
addEventHandler("Locks", root, function()
  local l_7_0 = getElementData(source, "isOwner")
  if not isElement(l_7_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_7_0 and isElement(l_7_0) then
    local l_7_1 = getElementData(l_7_0, "Locked")
    if l_7_1 == true then
      removeElementData(l_7_0, "Locked")
      outputChatBox(" *Car unlocked.", source, 255, 0, 0)
    else
      setElementData(l_7_0, "Locked", true)
      outputChatBox(" *Car locked.", source, 0, 255, 0)
    end
  end
end
)
addEvent("Engine", true)
addEventHandler("Engine", root, function()
  local l_8_0 = getElementData(source, "isOwner")
  if not isElement(l_8_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_8_0 and isElement(l_8_0) then
    local l_8_1 = getVehicleEngineState(l_8_0)
    if not l_8_1 then
      setVehicleEngineState(l_8_0, not l_8_1)
      outputChatBox(" *Engine started.", source, 0, 255, 0)
    else
      setVehicleEngineState(l_8_0, not l_8_1)
      outputChatBox(" *Engine stopped.", source, 255, 0, 0)
    end
  end
end
)
addEvent("Lights", true)
addEventHandler("Lights", root, function()
  local l_9_0 = getElementData(source, "isOwner")
  if not isElement(l_9_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_9_0 and isElement(l_9_0) then
    local l_9_1 = getVehicleOverrideLights(l_9_0) == 2
    if not l_9_1 then
      setVehicleOverrideLights(l_9_0, 2)
      outputChatBox(" *Lights On.", source, 0, 255, 0)
    else
      setVehicleOverrideLights(l_9_0, 1)
      outputChatBox(" *Lights Off.", source, 255, 0, 0)
    end
  end
end
)
addEvent("Nitrous", true)
addEventHandler("Nitrous", root, function()
  local l_10_0 = getElementData(source, "isOwner")
  if not isElement(l_10_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_10_0 and isElement(l_10_0) then
    addVehicleUpgrade(l_10_0, 1010)
    outputChatBox(" *Nitrous upgrade has been added to your vehicle.", source, 0, 255, 0)
  end
end
)
addEvent("Arrow", true)
addEventHandler("Arrow", root, function()
  local l_11_0 = getElementData(source, "isOwner")
  if not isElement(l_11_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_11_0 and isElement(l_11_0) then
    if isElement(l_0_5[source]) then
      destroyElement(l_0_5[source])
      outputChatBox(" *The arrow has been removed from your vehicle.", source, 255, 0, 0)
    else
      local l_11_1, l_11_2, l_11_3 = getElementPosition(l_11_0)
      l_0_5[source] = createObject(1318, l_11_1, l_11_2, l_11_3 + 2, 0, 0, 0)
      attachElements(l_0_5[source], l_11_0, 0, 0, 2)
      outputChatBox(" *The arrow has been attached to your vehicle.", source, 0, 255, 0)
    end
  end
end
)
addEvent("Colors", true)
addEventHandler("Colors", root, function()
  local l_12_0 = getElementData(source, "isOwner")
  if not isElement(l_12_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_12_0 and isElement(l_12_0) then
    if not l_0_2[source] then
      l_0_2[source] = true
      l_0_0[source] = setTimer(randomVehColors, 1000, 0, l_12_0, source)
      outputChatBox(" *Random colors is now enabled.", source, 0, 255, 0)
    else
      l_0_2[source] = false
      if isTimer(l_0_0[source]) then
        killTimer(l_0_0[source])
        outputChatBox(" *Random colors is now disabled", source, 255, 0, 0)
      end
    end
  end
end
)
randomVehColors = function(l_13_0, l_13_1)
  if not isElement(l_13_0) and isElement(l_13_1) then
    if isTimer(l_0_0[l_13_1]) then
      killTimer(l_0_0[l_13_1])
    end
    l_0_2[l_13_1] = false
    return
  end
  if isElement(l_13_0) then
    local l_13_2 = math.random(0, 255)
    local l_13_3 = math.random(0, 255)
    local l_13_4 = math.random(0, 255)
    local l_13_5 = math.random(0, 255)
    setVehicleColor(l_13_0, l_13_2, l_13_3, l_13_4, l_13_5)
  end
end
 
addEvent("Smoke", true)
addEventHandler("Smoke", root, function()
  local l_14_0 = getElementData(source, "isOwner")
  if not isElement(l_14_0) then
    outputChatBox(" *You do not have a car!", source, 255, 0, 0)
    return
  end
  if l_14_0 and isElement(l_14_0) and l_0_3[source] then
    l_0_3[source] = false
    if isTimer(l_0_1[source]) then
      killTimer(l_0_1[source])
    end
    if isElement(l_0_4[source]) then
      destroyElement(l_0_4[source])
      l_0_4[source] = nil
    end
    outputChatBox(" *Smoke is now disabled.", source, 255, 0, 0)
    return
  end
  if l_14_0 and isElement(l_14_0) and not l_0_3[source] then
    l_0_3[source] = true
    l_0_1[source] = setTimer(addSmoke, 1000, 0, l_14_0, source)
    outputChatBox(" *Smoke is now enabled.", source, 0, 255, 0)
  end
end
)
addSmoke = function(l_15_0, l_15_1)
  if not isElement(l_15_0) and isElement(l_15_1) then
    if isTimer(l_0_1[l_15_1]) then
      killTimer(l_0_1[l_15_1])
    end
    if isElement(l_0_4[l_15_1]) then
      destroyElement(l_0_4[l_15_1])
      l_0_4[l_15_1] = nil
    end
    l_0_3[l_15_1] = false
    return
  end
  local l_15_2 = getElementSpeed(l_15_0, "kmh")
  if l_15_2 >= 120 then
    local l_15_3, l_15_4, l_15_5 = getElementPosition(l_15_0)
    if isElement(l_0_4[l_15_1]) then
      return
    end
    l_0_4[l_15_1] = createObject(2780, l_15_3, l_15_4, l_15_5 - 2, 0, 0, 0)
    setElementAlpha(l_0_4[l_15_1], 0)
    attachElements(l_0_4[l_15_1], l_15_0, 0, -2, -1)
  elseif isElement(l_0_4[l_15_1]) then
    destroyElement(l_0_4[l_15_1])
    l_0_4[l_15_1] = nil
  end
end
 
addEvent("Armor", true)
addEventHandler("Armor", root, function()
  if isElement(source) then
    setPedArmor(source, 100)
    outputChatBox("Your armor has been set to 100%.", source, 0, 255, 0)
  end
end
)
addEvent("Health", true)
addEventHandler("Health", root, function()
  if isElement(source) then
    setElementHealth(source, 200)
    outputChatBox("Your health has been set to 100%.", source, 0, 255, 0)
  end
end
)
addEvent("SetFStyle", true)
addEventHandler("SetFStyle", root, function(l_18_0)
  if isElement(source) and tonumber(l_18_0) then
    setPedFightingStyle(source, tonumber(l_18_0))
  end
end
)
addEvent("Stats", true)
addEventHandler("Stats", root, function()
  if isElement(source) then
    setPedStat(source, 23, 1000)
    setPedStat(source, 24, 1000)
    setPedStat(source, 69, 1000)
    setPedStat(source, 70, 1000)
    setPedStat(source, 71, 1000)
    setPedStat(source, 72, 1000)
    setPedStat(source, 73, 1000)
    setPedStat(source, 74, 1000)
    setPedStat(source, 75, 1000)
    setPedStat(source, 76, 1000)
    setPedStat(source, 77, 1000)
    setPedStat(source, 78, 1000)
    setPedStat(source, 79, 1000)
    outputChatBox("Your weapon skills and max health has been set to maximum.", source, 0, 255, 0)
  end
end
)
getElementSpeed = function(l_20_0, l_20_1)
  if l_20_1 == nil then
    l_20_1 = 0
  end
  if isElement(l_20_0) then
    local l_20_2, l_20_3, l_20_4 = getElementVelocity(l_20_0)
    if l_20_1 == "mph" or l_20_1 == 1 or l_20_1 == "1" then
      return l_20_2 ^ 2 + l_20_3 ^ 2 + l_20_4 ^ 2 ^ 0.5 * 100
    else
      return l_20_2 ^ 2 + l_20_3 ^ 2 + l_20_4 ^ 2 ^ 0.5 * 1.61 * 100
    end
  else
    outputDebugString("Not an element. Can't get speed")
    return false
  end
end
 
addEvent("status", true)
addEventHandler("status", root, function()
  local l_21_0 = getPlayerAccount(source)
  local l_21_1 = getAccountName(l_21_0)
  if isObjectInACLGroup("user." .. l_21_1, aclGetGroup("Console")) then
    triggerClientEvent(source, "status", source)
  else
    triggerClientEvent(source, "statusF", source)
  end
end
)
open = function()
  local l_21_0 = getPlayerAccount(source)
  local l_21_1 = getAccountName(l_21_0)
  if isObjectInACLGroup("user."..l_21_1, aclGetGroup("Console")) then else return end
     triggerClientEvent(source, "showwindow", source)
  end
end
 
addEvent("showwindow", true)
addEventHandler("showwindow", getRootElement(), open)

 

Edited by Dimos7
  • Thanks 1
Link to comment

Hey man, thank you very much for spending your time time doing this for me... :)

But it isn't working... I'm getting the messages that I triggered serverside event shiwwinow, but the event is not added serversie. 

and I triggered serverside event status, but event is not added serverside. :( 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...