Cronoss Posted January 29, 2022 Share Posted January 29, 2022 I want to save the last position of a car (with owner) but the console keeps giving me a error (getAccount line) function guardarAuto(player) local veh = getNearestVehicle(player,5) or Ped.getOccupiedVehicle(player) if (veh) then local acc = player:getAccount() local owner = acc:getName() local location = player:getPosition() local rotation = player:getRotation() local int = player:getInterior() local dim = player:getDimension() local loc = toJSON({location.x,location.y,location.z}) local rot = toJSON({rotation.x,rotation.y,rotation.z}) if (veh:getData("vehicles:owner") == owner) then local id = getElementData(veh, "vehicles:id") end end end) addEventHandler("onPlayerQuit", root, guardarAuto) I know I post many scripting questions, sorry Link to comment
CastiaL Posted January 29, 2022 Share Posted January 29, 2022 function guardarAuto() player = source local veh = getNearestVehicle(player,5) or Ped.getOccupiedVehicle(player) if (veh) then local acc = player:getAccount() local owner = acc:getName() local location = player:getPosition() local rotation = player:getRotation() local int = player:getInterior() local dim = player:getDimension() local loc = toJSON({location.x,location.y,location.z}) local rot = toJSON({rotation.x,rotation.y,rotation.z}) if (veh:getData("vehicles:owner") == owner) then local id = getElementData(veh, "vehicles:id") end end end) addEventHandler("onPlayerQuit", root, guardarAuto) Can you try this 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now