Jump to content

[HELP] Destroy Car


Eweest

Recommended Posts

Hi guys! What's wrong here?

Server:

Vehicle = {} 
    function spawnCars(modelid , carN) 
            if (isElement(Vehicle[source])) then 
            return end 
            if ( modelid and carN) then 
             local playerX,playerY,playerZ = getElementPosition(source) 
             Vehicle[source] = createVehicle(modelid,playerX,playerY, playerZ) 
             setElementData(source,"veh",Vehicle[source]) 
             warpPedIntoVehicle(source,Vehicle[source]) 
             outputChatBox("You have spawned "..tostring(carN).. " !" ,player,255,255,0) 
             setElementData(source , "vehN" , carN) 
             g_VehicleData[vehicle] = { creator = source, timers = {} } 
             if not g_Trailers[modelid] then 
             if getOption('vehicles.idleexplode') then 
             g_VehicleData[vehicle].timers.fire = setTimer(commitArsonOnVehicle, getOption('vehicles.maxidletime'), 1, vehicle) 
             end 
             g_VehicleData[vehicle].timers.destroy = setTimer(unloadVehicle, getOption('vehicles.maxidletime') + (getOption('vehicles.idleexplode') and 10000 or 0), 1, vehicle) 
             end       
             destroyElement(vehN) 
             outputChatBox("Your Spawner :[ " ..tostring(carN).." ] is destroyed",player,255,255,0) 
        end 
    end 
addEvent("spawn",true) 
addEventHandler("spawn",root,spawnCars) 

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