Paplo Posted August 28, 2013 Share Posted August 28, 2013 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
iPrestege Posted August 28, 2013 Share Posted August 28, 2013 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
TAPL Posted August 28, 2013 Share Posted August 28, 2013 I assume that you want to attach the marker so you will need this too: attachElements Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now