saluta Posted June 26, 2021 Share Posted June 26, 2021 Spoiler function getVehicleInformation () local vehicle = getPedOccupiedVehicle(localPlayer) 76-->>>>>>> if vehiclesNoEngine[ getElementModel(vehicle) ] then setVehicleEngineState(vehicle, true) return false end if isPedInVehicle(localPlayer) and getPedOccupiedVehicleSeat(localPlayer) == 0 and getKeyState(e_KEY) then return true else return false end end 76 line error Error if vehiclesNoEngine [ getElementModel (vehicle) ] then Spoiler Link to comment
βurak Posted June 26, 2021 Share Posted June 26, 2021 getPedOccupedVehicle function returns false if player is not found in car so check if player is in car I'm not sure but it should be like this function getVehicleInformation () local vehicle = getPedOccupiedVehicle(localPlayer) local vehicleModel = getElementModel(vehicle) if (vehicle and vehiclesNoEngine[vehicleModel]) then setVehicleEngineState(vehicle, true) return false end if isPedInVehicle(localPlayer) and getPedOccupiedVehicleSeat(localPlayer) == 0 and getKeyState(e_KEY) then return true else return false end end Link to comment
saluta Posted June 27, 2021 Author Share Posted June 27, 2021 12 hours ago, Burak5312 said: getPedOccupedVehicle function returns false if player is not found in car so check if player is in car I'm not sure but it should be like this function getVehicleInformation () local vehicle = getPedOccupiedVehicle(localPlayer) local vehicleModel = getElementModel(vehicle) if (vehicle and vehiclesNoEngine[vehicleModel]) then setVehicleEngineState(vehicle, true) return false end if isPedInVehicle(localPlayer) and getPedOccupiedVehicleSeat(localPlayer) == 0 and getKeyState(e_KEY) then return true else return false end end Warning didn't help anyway Link to comment
βurak Posted June 27, 2021 Share Posted June 27, 2021 it will work like this function getVehicleInformation () local vehicle = getPedOccupiedVehicle(localPlayer) local vehicleModel if(vehicle) then vehicleModel = getElementModel(vehicle) end if (vehicle and vehiclesNoEngine[vehicleModel]) then setVehicleEngineState(vehicle, true) return false end if isPedInVehicle(localPlayer) and getPedOccupiedVehicleSeat(localPlayer) == 0 and getKeyState(e_KEY) then return true else return false end end Link to comment
saluta Posted June 28, 2021 Author Share Posted June 28, 2021 15 hours ago, Burak5312 said: it will work like this function getVehicleInformation () local vehicle = getPedOccupiedVehicle(localPlayer) local vehicleModel if(vehicle) then vehicleModel = getElementModel(vehicle) end if (vehicle and vehiclesNoEngine[vehicleModel]) then setVehicleEngineState(vehicle, true) return false end if isPedInVehicle(localPlayer) and getPedOccupiedVehicleSeat(localPlayer) == 0 and getKeyState(e_KEY) then return true else return false end end Thanks very much. 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