iiv03 Posted December 13, 2019 Share Posted December 13, 2019 hey why setVehicleComponentVisible not work with createVehicle? Link to comment
JeViCo Posted December 14, 2019 Share Posted December 14, 2019 On my opinion vehicle creation takes a little amount of time to manage it's data. Try to use setTimer setTimer(setVehicleComponentVisible, 100, 1, vehicle, component, visible) 1 Link to comment
iiv03 Posted December 14, 2019 Author Share Posted December 14, 2019 (edited) 2 hours ago, JeViCo said: On my opinion vehicle creation takes a little amount of time to manage it's data. Try to use setTimer setTimer(setVehicleComponentVisible, 100, 1, vehicle, component, visible) thx and i wanna loop only in vehicle infernus so do like this? function test() for id, vehicle in ipairs(getElementsByType("vehicle")) do if vehicle == 411 then setTimer(setVehicleComponentVisible, 100, 1, vehicle, "blablabla", false) end end end addEventHandler("onClientResourceStart", resourceRoot, test) edit: nvm i forget add getElementModel Edited December 14, 2019 by xFabel Link to comment
JeViCo Posted December 14, 2019 Share Posted December 14, 2019 Yes, you're right. A little mistake on line 3: if getElementModel(vehicle) == 411 then 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