Dzsozi (h03) Posted May 8, 2014 Share Posted May 8, 2014 Hello guys, I have a little problem. In my vehicle shops system I made a function that creates a blip which is attached to the vehicle that you bought. The only problem is that it's not being destroyed when I delete the vehicle, or if it's get blowned up. What's the problem with my code? Here's a little part of it where I create and try to destroy the blip: if veh then x, y, z = getElementPosition( veh ) vehicleblip = createBlip( x, y, z, 55, 0, 0, 0, 255, thePlayer ) end addEventHandler("onElementDestroy", getRootElement(), function () if veh then destroyBlip(vehicleblip) end end) Thanks in advance! Link to comment
Castillo Posted May 8, 2014 Share Posted May 8, 2014 How many blips are being created? if it's more than one, then the variable will be overwritten. P.S: You aren't checking if "veh" is equal to "source", which is the element that was destroyed. Link to comment
TAPL Posted May 9, 2014 Share Posted May 9, 2014 Do you have the function destroyBlip defined in your code? 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