Jump to content

[Tank Parts] Error


stefutz101

Recommended Posts

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!! :D:)

Link to comment

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...