Jump to content

Function:respawnAllVehicles - War Of Empire -


laserlaser

Recommended Posts

Hello,this my new function :) respawnAllVehicles with exceptions...

Ex use:

  
v1 = createVehicle(...) 
respawnAllVehicles(v1) 
((( Here, it just does not respawn vehicle  "v1" ))) 
  

or

  
v1 = createVehicle(...) 
v2 = createVehicle(...) 
v3 = createVehicle(...) 
respawnAllVehicles(v1,v3) 
((( Here, it just does respawn vehicle  "v2" ))) 
  

The Function :

function respawnAllVehicles(...) 
    local ex = {...} 
    local cars = getElementsByType("vehicle") 
     
    for k,v in ipairs(cars) do 
        local carEx=0 
        for a,c in ipairs(ex) do 
            if c == ex then 
                carEx=1 
            end 
        end 
        if carEx~=1 then 
            respawnVehicle(v) 
        end 
    end 
end 

- War Of Empire LUA Team -

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