Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. addEventHandler("onPlayerVehicleExit", getRootElement(), function(veh,seat,jacker)
  2. if seat == 0 then
  3. --local theVehicle = getPedOccupiedVehicle(thePlayer)
  4. if getElementData(veh, "private_car") == true then
  5. local x, y, z = getElementPosition(veh)
  6. local rx, ry, rz = getElementRotation(veh)
  7. local healthv = getElementHealth(veh)
  8. local panelv = getVehiclePanels(veh)
  9. local doorv = getVehicleDoors(veh)
  10. local lightv = getVehicleLights(veh)
  11. local r,g,b,a,r2,g2,b2,a2,r3,g3,b3,a3,r4,g4,b4,a4 = getVehicleColor(veh, 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(veh)
  14. local colorheadlightv = toJSON({r=rh, g=gh, b=bh})
  15. local w1 = getVehicleEngineState(veh)
  16. local w2 = isElementFrozen(veh)
  17. local w3 = getVehicleOverrideLights(veh)
  18. local statuscarv = ""..w1..","..w2..","..w3..""
  19. for i,v in ipairs(getElementsByType("player")) do outputChatBox(statuscarv,v) end
  20. 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"))
  21. cancelEvent()
  22. end
  23. end
  24. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement