Jump to content

whats wrong?


Paplo

Recommended Posts

function onResourceStart() 
local vehicles = getElementsByType ( "vehicle" ) 
local x, y, z = getElementPosition ( vehicles ) 
createMarker ( x, y, z, "cylinder", 1.5, 255, 255, 0, 170 ) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) 

i want to all vehicle have marker

Link to comment
function onResourceStart() 
local vehicles = getElementsByType ( "vehicle" ) 
local x, y, z = getElementPosition ( vehicles ) 
createMarker ( x, y, z, "cylinder", 1.5, 255, 255, 0, 170 ) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) 

i want to all vehicle have marker

addEventHandler('onClientResourceStart',root, 
    function (      ) 
        for _,vehicles in next,getElementsByType 'vehicle' do 
            local x,y,z = getElementPosition ( vehicles ) 
            createMarker ( x, y, z, "cylinder", 1.5, 255, 255, 0, 170 ) 
        end 
    end 
) 

Should work.

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