villr Posted June 12, 2011 Share Posted June 12, 2011 What's the problem with this code? It dont wanna start when i added that you'll see where marker = createMarker(-1356.8,-260.0,15.6, "arrow", 2,255, 255,0) marker2 = createMarker(2.67,32.97,1201, "arrow", 2,255,255,0) marker1 = createMarker(-1356.8,-260.0,15.6,"arrow",2,255,255,0) marker3 = createMarker(2.67,32.97,1201, "arrow", 2,255,255,0) setElementInterior(marker2,1) veh = createVehicle(519,-1130.24,-405.96,16,0,0,90) veh1 = createVehicle(409,394.2,2603.26,51.0,0,0,10) setVehicleColor(veh1,0,0,0,0) setElementInterior(marker2,1) setTimer(function() local x,y,z = getElementPosition(veh) setElementPosition(marker,x-4,y+2,z+1,100) setTimer(function() local x,y,z = getElementPosition(veh1) setElementPosition(marker2,x-4,y+2,z+1,100) -- when i add this the script stops to work idk why? setElementInterior(marker, 0)end,1000,0) function customInt(thePlayer) if source ~= marker then return end if getElementType(thePlayer) == "vehicle" or getPedOccupiedVehicle(thePlayer) then return end local x,y,z = getElementPosition(marker2) setElementPosition(thePlayer,x,y,z) setElementInterior(thePlayer,getElementInterior(marker2)) end addEventHandler( "onMarkerHit",getRootElement(),customInt) function customInt(thePlayer) if source ~= marker2 then return end if getElementType(thePlayer) == "vehicle" or getPedOccupiedVehicle(thePlayer) then return end local x,y,z = getElementPosition(marker) setElementPosition(thePlayer,x,y,z) setElementInterior(thePlayer,getElementInterior(marker)) end addEventHandler( "onMarkerHit",getRootElement(),customInt) Link to comment
JR10 Posted June 12, 2011 Share Posted June 12, 2011 thats AG ADAM script why did u take it? Link to comment
villr Posted June 12, 2011 Author Share Posted June 12, 2011 no he wroted it here beacuse i had lost my password but he posted it here and it was mine and he helped me. But now i got problems again with it. Link to comment
Aibo Posted June 12, 2011 Share Posted June 12, 2011 because you're messing up the whole syntax by simply copying a line. the function is inside setTimer (whis is not closed on the same line). here's how it should be (assuming you want something done in the same timer), with line breaks: setTimer(function() local x,y,z = getElementPosition(veh) setElementPosition(marker,x-4,y+2,z+1,100) x,y,z = getElementPosition(veh1) setElementPosition(marker2,x-4,y+2,z+1,100) setElementInterior(marker, 0) end,1000,0) 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