Ryan2233 Posted June 1, 2018 Share Posted June 1, 2018 function detectHit() if getElementType(markerBlip)=="vehicle" then outputChatBox("Get out of that vehicle",markerBlip,255,0,0) else outputChatBox("Get out of that vehicle",markerBlip,255,0,0) end end function devMarker() local deliveryMarker = createMarker(-2300.9340820313, -1649.5125732422, 483.56658935547, "checkpoint") local markerBlip = createBlipAttachedTo(deliveryMarker, 23) addEventHandler("onMarkerHit", markerBlip, devMarker) end function setupSpawns(thePlayer, command) local x, y, z = getElementPosition(thePlayer) local helicopter = createVehicle(417, 0, 0, 0) local spawnVehicle = spawnVehicle (helicopter, x+3, y+3, z) if spawnVehicle then exports.SANGcommands:sendMessage("A helicopter has been abandonded (R Icon). Deliver it for a good payday!", 255, 255, 255) local heliBlip = createBlipAttachedTo(helicopter, 34) end end addCommandHandler("startheli", setupSpawns) addCommandHandler("startheli", devMarker) setElementParent(heliBlip, helicopter) [expected element at argument 1, got nil] ~ How to fix? Link to comment
Skully Posted June 1, 2018 Share Posted June 1, 2018 (edited) Try this. function detectHit() if getElementType(markerBlip)=="vehicle" then outputChatBox("Get out of that vehicle",markerBlip,255,0,0) else outputChatBox("Get out of that vehicle",markerBlip,255,0,0) end end function devMarker() local deliveryMarker = createMarker(-2300.9340820313, -1649.5125732422, 483.56658935547, "checkpoint") local markerBlip = createBlipAttachedTo(deliveryMarker, 23) end addEventHandler("onMarkerHit", markerBlip, devMarker) function setupSpawns(thePlayer, command) local x, y, z = getElementPosition(thePlayer) local helicopter = createVehicle(417, 0, 0, 0) local spawned = spawnVehicle (helicopter, x+3, y+3, z) if spawned then exports.SANGcommands:sendMessage("A helicopter has been abandonded (R Icon). Deliver it for a good payday!", 255, 255, 255) local heliBlip = createBlipAttachedTo(helicopter, 34) setElementParent(heliBlip, helicopter) end end addCommandHandler("startheli", setupSpawns) addCommandHandler("startheli", devMarker) Edited June 1, 2018 by Skully 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