Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. addEventHandler("onVehicleExit", getRootElement(), function(thePlayer, seat)
  2. if seat == 0 then
  3. --local theVehicle = getPedOccupiedVehicle(thePlayer)
  4. if getElementData(source, "private_car") == true then
  5. local x, y, z = getElementPosition(source)
  6. local rx, ry, rz = getElementRotation(source)
  7. local healthv = getElementHealth(source)
  8. local panelv = getVehiclePanels(source)
  9. local doorv = getVehicleDoors(source)
  10. local lightv = getVehicleLights(source)
  11. local r,g,b,a,r2,g2,b2,a2,r3,g3,b3,a3,r4,g4,b4,a4 = getVehicleColor(source, true)
  12. local colorv = toJSON({r=r,g=g,b=b,a=a,r2=r2,g2=g2,b2=b2,a2=a2,r3=r3,g3=g3,b3=b3,a3=a3,r4=r4,g4=g4,b4=b4,a4=a4})
  13. local rh, gh, bh = getVehicleHeadLightColor(source)
  14. local colorheadlightv = toJSON({r=rh, g=gh, b=bh})
  15. local w1 = getVehicleEngineState(source)
  16. local w2 = nil
  17. if not isElementFrozen(soruce) then w2="false" else w2="true" end
  18. local w3 = getVehicleOverrideLights(source)
  19. local statuscarv = ""..w1..","..w2..","..w3..""
  20. result = toJSON(statuscarv)
  21. dbExec(dbsuccess, "UPDATE future_vehicle SET x = ?, y = ?, z = ?, rx = ?, ry = ?, rz = ?, health = ?, panels = ?, doors = ?, lights = ?, color = ?, headlightcolor = ?, vehstatus = ? WHERE id = ?", x, y, z, rx, ry, rz, healthv, panelv, doorv, lightv, colorv, colorheadlightv, result, getElementData(source, "vehicle:id"))
  22. cancelEvent()
  23. end
  24. end
  25. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement