Jump to content

vehicle on water


yMassai

Recommended Posts

Posted

can anyone help me?

i want that when my vehicle hit on the water within a minute he appears in the parking lot.

the parking i will determine the coordinates x, y, z.

Posted
function resurgeveiculo () 
    if isElementInWater(vehicletrafic[source]) then 
        setTimer(  
        setElementPosition ( vehicletrafic[source] , 1650.54077, -1626.85131, 24.89843 ) 
        , 10000, 1, source, true,1 ) 
    end 
end 
addEventHandler("onClientResourceStart", root, resurgeveiculo) 

Posted

read the 'setTimer' arguments

https://wiki.multitheftauto.com/wiki/SetTimer

i think it should be like this :

function resurgeveiculo () 
    if isElementInWater(vehicletrafic[source]) then 
        setTimer( setElementPosition, 10000, 1, vehicletrafic[source] , 1650.54077, -1626.85131, 24.89843 ) 
    end 
end 
addEventHandler("onClientResourceStart", root, resurgeveiculo) 

Posted
setTimer(  
    function( ) 
        for _, aVehicle in next, getElementsByType 'vehicle' do 
            if isElementInWater( aVehicle ) then 
                setElementPosition( aVehicle, 1650.54077, -1626.85131, 24.89843 ) 
            end 
        end 
    end, 5000, 0  
) 

Posted
function resurgeveiculo () 
    if isElementInWater(vehicletrafic[source]) then 
        setTimer( setElementPosition, 1000, 1, vehicletrafic[source], 1650.54077, -1626.85131, 24.89843 ) 
    end 
end 
setTimer( resurgeveiculo, 400, 0 ) 

Posted

to DNL

bad argument @ 'isElementInWater' [expected element at argument 1, got nil] 

tapl, the intention is to only remove the water vehicle

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