Jump to content

no car respawn


zombienation

Recommended Posts

Posted

hello,

i'm using a vehicle panel, but i'd like to know how to fix it so that when the car is destroyed, that the car will be deleted, not respawn but deleted, at this moment the wreckage of the car stays where the car is destroyed

is there anybody who can help me with this?

thx

Posted

I don't want to sound rude, but the client side could be done with just some lines using a table instead of adding manually each vehicle.

--vehicle spawning 
vehicles = {} 
  
function spawnv ( id ) 
    if getElementDimension (source) == 10 then 
        outputChatBox ( "You can't use vehicle here", source, 255, 0, 0 ) 
    else  
    if vehicles[source] and isElement(vehicles[source]) then 
        destroyElement(vehicles[source]) 
    end 
    local x, y, z = getElementPosition ( source ) 
    local xr, yr, zr = getElementRotation ( source ) 
    vehicles[source] = createVehicle ( id, x, y, z + 0.5, xr, yr, zr ) 
    warpPedIntoVehicle(source, vehicles[source]) 
    addEventHandler("onVehicleExplode",vehicles[source],function () destroyElement(source) end) 
    end 
end 
addEvent ( "spawn", true ) 
addEventHandler ( "spawn", root, spawnv ) 
  
function destroyveh () 
    if vehicles[source] and isElement(vehicles[source]) then 
        destroyElement(vehicles[source]) 
    else  
        outputChatBox( "There is no old car.", source ) 
    end 
end 
addEvent ( "destroy", true ) 
addEventHandler ( "destroy", root, destroyveh ) 

It should destroy the vehicle just after explode.

Posted

still other vehicles bounded to maps or spawned with admin panel dont spawn away after destroying, how do i create a script with

addEvent ( "destroy", true )

addEventHandler ( "destroy", root, destroyveh )

that will spawn away all vehicles that gets destroyed no mather how they spawned?

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