BieHDC Posted August 23, 2013 Share Posted August 23, 2013 Why get with this code ALL vehicle blown and not only the ID 598 ? police = getVehiclesOfType ( 598 ) for vehicleKey, vehicleValue in ipairs ( police ) do blowVehicle ( vehicleValue ) end Link to comment
xXMADEXx Posted August 23, 2013 Share Posted August 23, 2013 This makes ID 598 not explode: police = getVehiclesOfType ( 598 ) If you want every vehicle to explode use: police = getElementsByType ( "vehicle" ) Link to comment
BieHDC Posted August 23, 2013 Author Share Posted August 23, 2013 i want that only ID 598 explodes and no other one and to blow every vehicle you can use root = getRootElement () blowVehicle ( root ) Link to comment
|Mr|-Talal07-| Posted August 23, 2013 Share Posted August 23, 2013 use this functions getElementsByType -- vehicles getElementModel blowVehicle Link to comment
BieHDC Posted August 23, 2013 Author Share Posted August 23, 2013 Like so? carsall = getElementsByType("vehicle", root) for vehicleKey, vehicleValue in ipairs ( carsall ) do if getElementModel == 598 then blowVehicle ( vehicleValue ) end edit: so nothing happens :c Link to comment
./BlackBird# Posted August 23, 2013 Share Posted August 23, 2013 carsall = getElementsByType("vehicle", root) for vehicleKey, vehicleValue in ipairs ( carsall ) do if getElementModel == 598 then blowVehicle ( vehicleValue ) end end Link to comment
./BlackBird# Posted August 23, 2013 Share Posted August 23, 2013 carsall = getElementsByType("vehicle", root) for vehicleKey, vehicleValue in ipairs ( carsall ) do if getElementModel(vehicleValue ) == 598 then blowVehicle ( vehicleValue ) end end 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