Advertisement
Guest User

ServerSide VIPsystem Nexus decompiled

a guest
Oct 11th, 2017
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.82 KB | None | 0 0
  1. - Decompiled Server.luac
  2.  
  3. local l_0_0 = {}
  4. local l_0_1 = {}
  5. local l_0_2 = {}
  6. local l_0_3 = {}
  7. local l_0_4 = {}
  8. local l_0_5 = {}
  9.  
  10. addEventHandler("onPlayerQuit", root, function()
  11.   if isElement(source) and getElementData(source, "isOwner") ~= nil and getElementType(getElementData(source, "isOwner")) == "vehicle" then
  12.     destroyElement(getElementData(source, "isOwner"))
  13.     removeElementData(source, "isOwner")
  14.     if isTimer(l_0_0[source]) then
  15.       killTimer(l_0_0[source])
  16.     end
  17.     if isTimer(l_0_1[source]) then
  18.       killTimer(l_0_1[source])
  19.     end
  20.     if isElement(l_0_4[source]) then
  21.       destroyElement(l_0_4[source])
  22.       l_0_4[source] = nil
  23.     end
  24.     if isElement(l_0_5[source]) then
  25.       destroyElement(l_0_5[source])
  26.       l_0_5[source] = nil
  27.     end
  28.   end
  29. end
  30. )
  31. createMyVehicle = function(l_2_0, l_2_1, l_2_2, l_2_3)
  32.   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
  33.     local l_2_4 = getPlayerAccount(source)
  34.     local l_2_5 = getAccountName(l_2_4)
  35.     local l_2_6 = getPlayerName(source)
  36.     local l_2_7 = l_2_6:gsub("#%x%x%x%x%x%x", "")
  37.     theVehicle = createVehicle(l_2_0, l_2_1 + 2, l_2_2 + 2, l_2_3)
  38.     setVehicleDamageProof(theVehicle, true)
  39.     setElementData(source, "isOwner", theVehicle)
  40.     setElementData(theVehicle, "Owner", l_2_5)
  41.     setElementData(theVehicle, "OwnerName", l_2_7)
  42.     setElementData(theVehicle, "Locked", true)
  43.     return
  44.   end
  45.   if l_2_0 and l_2_1 and l_2_2 and l_2_3 then
  46.     local l_2_8 = getPedOccupiedVehicle(source)
  47.     local l_2_9 = getElementData(source, "isOwner")
  48.     if isPedInVehicle(source) and isElement(l_2_8) and isElement(l_2_9) and l_2_8 == l_2_9 then
  49.       setElementModel(l_2_9, l_2_0)
  50.       return
  51.     end
  52.   end
  53.   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
  54.     local l_2_10 = getPlayerAccount(source)
  55.     local l_2_11 = getAccountName(l_2_10)
  56.     local l_2_12 = getPlayerName(source):gsub("#%x%x%x%x%x%x", "")
  57.     if isElement(getElementData(source, "isOwner")) then
  58.       destroyElement(getElementData(source, "isOwner"))
  59.     end
  60.     removeElementData(source, "isOwner")
  61.     theVehicle = createVehicle(l_2_0, l_2_1 + 2, l_2_2 + 2, l_2_3)
  62.     setVehicleDamageProof(theVehicle, true)
  63.     setElementData(source, "isOwner", theVehicle, true)
  64.     setElementData(theVehicle, "Owner", l_2_11)
  65.     setElementData(theVehicle, "OwnerName", l_2_12)
  66.     setElementData(theVehicle, "Locked", true)
  67.   end
  68. end
  69.  
  70. addEvent("createVehicleFromGUI", true)
  71. addEventHandler("createVehicleFromGUI", root, createMyVehicle)
  72. addEventHandler("onVehicleStartEnter", root, function(l_3_0)
  73.   local l_3_1 = getElementData(source, "Owner")
  74.   local l_3_2 = getElementData(source, "Locked")
  75.   if l_3_1 and l_3_2 then
  76.     local l_3_3 = getPlayerAccount(l_3_0)
  77.     if getAccountName(l_3_3) ~= getElementData(source, "Owner") then
  78.       cancelEvent()
  79.       b = math.random(0, 255)
  80.       g = math.random(0, 255)
  81.       r = math.random(0, 255)
  82.       outputChatBox(" *[ Private car owned by " .. getElementData(source, "OwnerName") .. " ]", l_3_0, r, g, b, true)
  83.     else
  84.       b = math.random(0, 255)
  85.       g = math.random(0, 255)
  86.       r = math.random(0, 255)
  87.       outputChatBox(" *[ Welcome \226\152\186 ]", l_3_0, r, b, g, true)
  88.     end
  89.   end
  90. end
  91. )
  92. addEvent("Spawn", true)
  93. addEventHandler("Spawn", root, function()
  94.   local l_4_0, l_4_1, l_4_2 = getElementPosition(source)
  95.   local l_4_3 = getElementData(source, "isOwner")
  96.   if not isElement(l_4_3) then
  97.     outputChatBox(" *You do not have a car!", source, 255, 0, 0)
  98.     return
  99.   end
  100.   if l_4_3 and isElement(l_4_3) then
  101.     setElementPosition(getElementData(source, "isOwner"), l_4_0 + 2, l_4_1, l_4_2 + 1)
  102.     outputChatBox(" *Car Spawned.", source, 255, 0, 0)
  103.   end
  104. end
  105. )
  106. addEvent("Warp", true)
  107. addEventHandler("Warp", root, function()
  108.   local l_5_0 = getElementData(source, "isOwner")
  109.   if not isElement(l_5_0) then
  110.     outputChatBox(" *You do not have a car!", source, 255, 0, 0)
  111.     return
  112.   end
  113.   if l_5_0 and isElement(l_5_0) then
  114.     fadeCamera(source, false, 0.5)
  115.     setTimer(fadeCamera, 500, 1, source, true)
  116.     warpPedIntoVehicle(source, l_5_0)
  117.   end
  118. end
  119. )
  120. addEvent("Destroy", true)
  121. addEventHandler("Destroy", root, function()
  122.   local l_6_0 = getElementData(source, "isOwner")
  123.   if not isElement(l_6_0) then
  124.     outputChatBox(" *You do not have a car!", source, 255, 0, 0)
  125.     return
  126.   end
  127.   if l_6_0 and isElement(l_6_0) then
  128.     destroyElement(l_6_0)
  129.     outputChatBox(" *Car Destroyed.", source, 255, 0, 0)
  130.     removeElementData(source, "isOwner")
  131.     if isElement(l_0_5[source]) then
  132.       destroyElement(l_0_5[source])
  133.       l_0_5[source] = nil
  134.     end
  135.     if isElement(l_0_4[source]) then
  136.       destroyElement(l_0_4[source])
  137.       l_0_4[source] = nil
  138.     end
  139.   end
  140. end
  141. )
  142. addEvent("Locks", true)
  143. addEventHandler("Locks", root, function()
  144.   local l_7_0 = getElementData(source, "isOwner")
  145.   if not isElement(l_7_0) then
  146.     outputChatBox(" *You do not have a car!", source, 255, 0, 0)
  147.     return
  148.   end
  149.   if l_7_0 and isElement(l_7_0) then
  150.     local l_7_1 = getElementData(l_7_0, "Locked")
  151.     if l_7_1 == true then
  152.       removeElementData(l_7_0, "Locked")
  153.       outputChatBox(" *Car unlocked.", source, 255, 0, 0)
  154.     else
  155.       setElementData(l_7_0, "Locked", true)
  156.       outputChatBox(" *Car locked.", source, 0, 255, 0)
  157.     end
  158.   end
  159. end
  160. )
  161. addEvent("Engine", true)
  162. addEventHandler("Engine", root, function()
  163.   local l_8_0 = getElementData(source, "isOwner")
  164.   if not isElement(l_8_0) then
  165.     outputChatBox(" *You do not have a car!", source, 255, 0, 0)
  166.     return
  167.   end
  168.   if l_8_0 and isElement(l_8_0) then
  169.     local l_8_1 = getVehicleEngineState(l_8_0)
  170.     if not l_8_1 then
  171.       setVehicleEngineState(l_8_0, not l_8_1)
  172.       outputChatBox(" *Engine started.", source, 0, 255, 0)
  173.     else
  174.       setVehicleEngineState(l_8_0, not l_8_1)
  175.       outputChatBox(" *Engine stopped.", source, 255, 0, 0)
  176.     end
  177.   end
  178. end
  179. )
  180. addEvent("Lights", true)
  181. addEventHandler("Lights", root, function()
  182.   local l_9_0 = getElementData(source, "isOwner")
  183.   if not isElement(l_9_0) then
  184.     outputChatBox(" *You do not have a car!", source, 255, 0, 0)
  185.     return
  186.   end
  187.   if l_9_0 and isElement(l_9_0) then
  188.     local l_9_1 = getVehicleOverrideLights(l_9_0) == 2
  189.     if not l_9_1 then
  190.       setVehicleOverrideLights(l_9_0, 2)
  191.       outputChatBox(" *Lights On.", source, 0, 255, 0)
  192.     else
  193.       setVehicleOverrideLights(l_9_0, 1)
  194.       outputChatBox(" *Lights Off.", source, 255, 0, 0)
  195.     end
  196.   end
  197. end
  198. )
  199. addEvent("Nitrous", true)
  200. addEventHandler("Nitrous", root, function()
  201.   local l_10_0 = getElementData(source, "isOwner")
  202.   if not isElement(l_10_0) then
  203.     outputChatBox(" *You do not have a car!", source, 255, 0, 0)
  204.     return
  205.   end
  206.   if l_10_0 and isElement(l_10_0) then
  207.     addVehicleUpgrade(l_10_0, 1010)
  208.     outputChatBox(" *Nitrous upgrade has been added to your vehicle.", source, 0, 255, 0)
  209.   end
  210. end
  211. )
  212. addEvent("Arrow", true)
  213. addEventHandler("Arrow", root, function()
  214.   local l_11_0 = getElementData(source, "isOwner")
  215.   if not isElement(l_11_0) then
  216.     outputChatBox(" *You do not have a car!", source, 255, 0, 0)
  217.     return
  218.   end
  219.   if l_11_0 and isElement(l_11_0) then
  220.     if isElement(l_0_5[source]) then
  221.       destroyElement(l_0_5[source])
  222.       outputChatBox(" *The arrow has been removed from your vehicle.", source, 255, 0, 0)
  223.     else
  224.       local l_11_1, l_11_2, l_11_3 = getElementPosition(l_11_0)
  225.       l_0_5[source] = createObject(1318, l_11_1, l_11_2, l_11_3 + 2, 0, 0, 0)
  226.       attachElements(l_0_5[source], l_11_0, 0, 0, 2)
  227.       outputChatBox(" *The arrow has been attached to your vehicle.", source, 0, 255, 0)
  228.     end
  229.   end
  230. end
  231. )
  232. addEvent("Colors", true)
  233. addEventHandler("Colors", root, function()
  234.   local l_12_0 = getElementData(source, "isOwner")
  235.   if not isElement(l_12_0) then
  236.     outputChatBox(" *You do not have a car!", source, 255, 0, 0)
  237.     return
  238.   end
  239.   if l_12_0 and isElement(l_12_0) then
  240.     if not l_0_2[source] then
  241.       l_0_2[source] = true
  242.       l_0_0[source] = setTimer(randomVehColors, 1000, 0, l_12_0, source)
  243.       outputChatBox(" *Random colors is now enabled.", source, 0, 255, 0)
  244.     else
  245.       l_0_2[source] = false
  246.       if isTimer(l_0_0[source]) then
  247.         killTimer(l_0_0[source])
  248.         outputChatBox(" *Random colors is now disabled", source, 255, 0, 0)
  249.       end
  250.     end
  251.   end
  252. end
  253. )
  254. randomVehColors = function(l_13_0, l_13_1)
  255.   if not isElement(l_13_0) and isElement(l_13_1) then
  256.     if isTimer(l_0_0[l_13_1]) then
  257.       killTimer(l_0_0[l_13_1])
  258.     end
  259.     l_0_2[l_13_1] = false
  260.     return
  261.   end
  262.   if isElement(l_13_0) then
  263.     local l_13_2 = math.random(0, 255)
  264.     local l_13_3 = math.random(0, 255)
  265.     local l_13_4 = math.random(0, 255)
  266.     local l_13_5 = math.random(0, 255)
  267.     setVehicleColor(l_13_0, l_13_2, l_13_3, l_13_4, l_13_5)
  268.   end
  269. end
  270.  
  271. addEvent("Smoke", true)
  272. addEventHandler("Smoke", root, function()
  273.   local l_14_0 = getElementData(source, "isOwner")
  274.   if not isElement(l_14_0) then
  275.     outputChatBox(" *You do not have a car!", source, 255, 0, 0)
  276.     return
  277.   end
  278.   if l_14_0 and isElement(l_14_0) and l_0_3[source] then
  279.     l_0_3[source] = false
  280.     if isTimer(l_0_1[source]) then
  281.       killTimer(l_0_1[source])
  282.     end
  283.     if isElement(l_0_4[source]) then
  284.       destroyElement(l_0_4[source])
  285.       l_0_4[source] = nil
  286.     end
  287.     outputChatBox(" *Smoke is now disabled.", source, 255, 0, 0)
  288.     return
  289.   end
  290.   if l_14_0 and isElement(l_14_0) and not l_0_3[source] then
  291.     l_0_3[source] = true
  292.     l_0_1[source] = setTimer(addSmoke, 1000, 0, l_14_0, source)
  293.     outputChatBox(" *Smoke is now enabled.", source, 0, 255, 0)
  294.   end
  295. end
  296. )
  297. addSmoke = function(l_15_0, l_15_1)
  298.   if not isElement(l_15_0) and isElement(l_15_1) then
  299.     if isTimer(l_0_1[l_15_1]) then
  300.       killTimer(l_0_1[l_15_1])
  301.     end
  302.     if isElement(l_0_4[l_15_1]) then
  303.       destroyElement(l_0_4[l_15_1])
  304.       l_0_4[l_15_1] = nil
  305.     end
  306.     l_0_3[l_15_1] = false
  307.     return
  308.   end
  309.   local l_15_2 = getElementSpeed(l_15_0, "kmh")
  310.   if l_15_2 >= 120 then
  311.     local l_15_3, l_15_4, l_15_5 = getElementPosition(l_15_0)
  312.     if isElement(l_0_4[l_15_1]) then
  313.       return
  314.     end
  315.     l_0_4[l_15_1] = createObject(2780, l_15_3, l_15_4, l_15_5 - 2, 0, 0, 0)
  316.     setElementAlpha(l_0_4[l_15_1], 0)
  317.     attachElements(l_0_4[l_15_1], l_15_0, 0, -2, -1)
  318.   elseif isElement(l_0_4[l_15_1]) then
  319.     destroyElement(l_0_4[l_15_1])
  320.     l_0_4[l_15_1] = nil
  321.   end
  322. end
  323.  
  324. addEvent("Armor", true)
  325. addEventHandler("Armor", root, function()
  326.   if isElement(source) then
  327.     setPedArmor(source, 100)
  328.     outputChatBox("Your armor has been set to 100%.", source, 0, 255, 0)
  329.   end
  330. end
  331. )
  332. addEvent("Health", true)
  333. addEventHandler("Health", root, function()
  334.   if isElement(source) then
  335.     setElementHealth(source, 200)
  336.     outputChatBox("Your health has been set to 100%.", source, 0, 255, 0)
  337.   end
  338. end
  339. )
  340. addEvent("SetFStyle", true)
  341. addEventHandler("SetFStyle", root, function(l_18_0)
  342.   if isElement(source) and tonumber(l_18_0) then
  343.     setPedFightingStyle(source, tonumber(l_18_0))
  344.   end
  345. end
  346. )
  347. addEvent("Stats", true)
  348. addEventHandler("Stats", root, function()
  349.   if isElement(source) then
  350.     setPedStat(source, 23, 1000)
  351.     setPedStat(source, 24, 1000)
  352.     setPedStat(source, 69, 1000)
  353.     setPedStat(source, 70, 1000)
  354.     setPedStat(source, 71, 1000)
  355.     setPedStat(source, 72, 1000)
  356.     setPedStat(source, 73, 1000)
  357.     setPedStat(source, 74, 1000)
  358.     setPedStat(source, 75, 1000)
  359.     setPedStat(source, 76, 1000)
  360.     setPedStat(source, 77, 1000)
  361.     setPedStat(source, 78, 1000)
  362.     setPedStat(source, 79, 1000)
  363.     outputChatBox("Your weapon skills and max health has been set to maximum.", source, 0, 255, 0)
  364.   end
  365. end
  366. )
  367. getElementSpeed = function(l_20_0, l_20_1)
  368.   if l_20_1 == nil then
  369.     l_20_1 = 0
  370.   end
  371.   if isElement(l_20_0) then
  372.     local l_20_2, l_20_3, l_20_4 = getElementVelocity(l_20_0)
  373.     if l_20_1 == "mph" or l_20_1 == 1 or l_20_1 == "1" then
  374.       return l_20_2 ^ 2 + l_20_3 ^ 2 + l_20_4 ^ 2 ^ 0.5 * 100
  375.     else
  376.       return l_20_2 ^ 2 + l_20_3 ^ 2 + l_20_4 ^ 2 ^ 0.5 * 1.61 * 100
  377.     end
  378.   else
  379.     outputDebugString("Not an element. Can't get speed")
  380.     return false
  381.   end
  382. end
  383.  
  384. addEvent("status", true)
  385. addEventHandler("status", root, function()
  386.   local l_21_0 = getPlayerAccount(source)
  387.   local l_21_1 = getAccountName(l_21_0)
  388.   if isObjectInACLGroup("user." .. l_21_1, aclGetGroup("VIP")) then
  389.     triggerClientEvent(source, "status", source)
  390.   else
  391.     triggerClientEvent(source, "statusF", source)
  392.   end
  393. end
  394. )
  395. open = function()
  396.   triggerClientEvent(source, "showwindow", source)
  397. end
  398.  
  399. addEvent("showwindow", true)
  400. addEventHandler("showwindow", getRootElement(), open)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement