Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEventHandler("onVehicleExit", getRootElement(), function(thePlayer, seat)
- if seat == 0 then
- --local theVehicle = getPedOccupiedVehicle(thePlayer)
- if getElementData(source, "private_car") == true then
- local x, y, z = getElementPosition(source)
- local rx, ry, rz = getElementRotation(source)
- local healthv = getElementHealth(source)
- local panelv = getVehiclePanels(source)
- local doorv = getVehicleDoors(source)
- local lightv = getVehicleLights(source)
- local r,g,b,a,r2,g2,b2,a2,r3,g3,b3,a3,r4,g4,b4,a4 = getVehicleColor(source, true)
- 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})
- local rh, gh, bh = getVehicleHeadLightColor(source)
- local colorheadlightv = toJSON({r=rh, g=gh, b=bh})
- local w1 = getVehicleEngineState(source)
- local w2 = nil
- if not isElementFrozen(soruce) then w2="false" else w2="true" end
- local w3 = getVehicleOverrideLights(source)
- local statuscarv = ""..w1..","..w2..","..w3..""
- result = toJSON(statuscarv)
- 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"))
- cancelEvent()
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement