stefutz101 Posted October 4, 2015 Share Posted October 4, 2015 Hi , i have a problem . I have a dayz gamemode and it don't have tank parts . So i decided to add it . But i have a problem . When i want to spawn cars i have error here : local tires,engine,parts = getVehicleAddonInfos (497) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) setElementData(vehCol,"Parts_inVehicle",math.random(0,parts)) In vehicle addons info i added tank parts . {497,0,1,1}, Where is problem ? Thanks in advance!! Link to comment
KariiiM Posted October 4, 2015 Share Posted October 4, 2015 What is that? local tires,engine,parts = getVehicleAddonInfos (497) Link to comment
stefutz101 Posted October 4, 2015 Author Share Posted October 4, 2015 What is that? local tires,engine,parts = getVehicleAddonInfos (497) vehicleAddonsInfo = { --ID | TIRES | ENGINE | Tank Parts | {422,4,1,1}, {470,4,1,1}, {468,2,1,1}, {522,2,1,1}, {433,6,1,1}, {411,4,1,1}, } Link to comment
stefutz101 Posted October 5, 2015 Author Share Posted October 5, 2015 Help , plese ? Solidsnake14 can you help me ? I saw you fix this error https://forum.multitheftauto.com/viewto ... 91&t=70730 , what is exactly the same with my error . Link to comment
KariiiM Posted October 5, 2015 Share Posted October 5, 2015 Try something like that, not tested but i think there's something wrong in definition local vehicleAddonsInfo = { --ID | TIRES | ENGINE | Tank Parts | {422,4,1,1}, {470,4,1,1}, {468,2,1,1}, {522,2,1,1}, {433,6,1,1}, {411,4,1,1}, } for index, val in ipairs (vehicleAddonsInfo) do local tires,engine,parts = val[2],val[3],val[4] setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) setElementData(vehCol,"Parts_inVehicle",math.random(0,parts)) end Link to comment
stefutz101 Posted October 5, 2015 Author Share Posted October 5, 2015 local tires,engine,parts = val[2],val[3],val[4] If i use that , there isn't possibility to take Engines,Tires,Tank Parts from another car ? Link to comment
KariiiM Posted October 5, 2015 Share Posted October 5, 2015 local tires,engine,parts = val[2],val[3],val[4] If i use that , there isn't possibility to take Engines,Tires,Tank Parts from another car ? No!,This will loop what's on the table 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