Jump to content

Dayz tank part


^_^ LOL ^_^

Recommended Posts

Posted (edited)

I try add tank part, by copying engine.

And i do all right im sure it.

but when i go in vehicle shows this

b3x1c2fwdspgaqehftz.png

And the 1360 line:

local w = dxGetTextWidth(parts.."/"..needparts.." Tank Parts",1.02,"default-bold") 

Thanks.

Edited by Guest
Posted

The error means "needparts" is return nothing, but to simply fix it use tostring()

local w = dxGetTextWidth(tostring(parts).."/"..tostring(needparts).." Tank Parts",1.02,"default-bold") 

Posted

Thank you it works. But have another

ERROR: [DayZ-MTA]\DayZ\vehicle_spawns.lua:325: bad argument #2 to 'random' (number expected, got nil)

325 line:

setElementData(vehCol,"Parts_inVehicle",math.random(0,parts)) 

Posted

Then, as Castillo said, you'd have to tell us where parts is defined. Because the error means that 'parts' is not a number(which math.random needs), it is a nil value meaning it's nothing.

Posted

Here it is, i think so.

setElementData(veh,"needparts",parts) 

if ((getElementData(col,"Parts_inVehicle") or 0) < tonumber(parts)) then 
    setVehicleEngineState ( veh, false ) 
    return 
end 

(getElementData(getElementData(veh,"parent"),"Parts_inVehicle") or 0) > tonumber(parts) 

  • 1 year later...

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...