Hukaeshi Posted January 2, 2018 Posted January 2, 2018 vehicleBlips = {} addEventHandler( "onClientElementStreamIn", getRootElement(), function() if getElementType( source ) == "vehicle" then setTimer( function( v ) vehicleBlips[v] = createBlipAttachedTo( v, 0, 1, 0, 0, 255, 150, 0 ) end, 100, 1, source ) end end ) function blip() if getElementType( source ) == "vehicle" then if vehicleBlips[source] then destroyElement( vehicleBlips[source] ) vehicleBlips[source] = nil end end removeEventHandler("onClientElementStreamOut", source, blip) removeEventHandler("onClientElementDestroy", source, blip) end addEventHandler( "onClientElementStreamOut", getRootElement(), blip ) Como puedo hacer que cuando un vehiculo se le de destroy, el blip de este desaparesca.
Melbourne Posted January 2, 2018 Posted January 2, 2018 onClientElementDestroy debe funcionarte, úsalo pero con addEventHandler.
Hukaeshi Posted January 2, 2018 Author Posted January 2, 2018 remplazo el removeEventHandler por addEventHandler?
Melbourne Posted January 2, 2018 Posted January 2, 2018 function blip() if getElementType( source ) == "vehicle" then if vehicleBlips[source] then destroyElement( vehicleBlips[source] ) vehicleBlips[source] = nil end end end addEventHandler( "onClientElementDestroy", getRootElement(), blip ) 1
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