Jump to content

[Help] Function has Fail


BieHDC

Recommended Posts

Posted

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 

Posted

i want that only ID 598 explodes

and no other one

and to blow every vehicle you can use

root = getRootElement () 
blowVehicle ( root ) 

Posted

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

Posted
carsall = getElementsByType("vehicle", root) 
    for vehicleKey, vehicleValue in ipairs ( carsall ) do 
        if getElementModel == 598 then 
        blowVehicle ( vehicleValue ) 
        end 
end  

Posted
carsall = getElementsByType("vehicle", root) 
    for vehicleKey, vehicleValue in ipairs ( carsall ) do 
        if getElementModel(vehicleValue ) == 598 then 
        blowVehicle ( vehicleValue ) 
        end 
end  

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