Bean666 Posted July 8, 2016 Posted July 8, 2016 how could i destroy the blip that was attached to the destroyed marker and attach a new blip to the new created marker again? function createMarkers ( ) loc = math.random ( #markers ) marker = createMarker ( markers[loc][1], markers[loc][2], markers[loc][3], "cylinder", 5.0, 0, 0, 255, 150 ) blip = createBlipAttachedTo(marker, 41) end function MarkerHit ( hitPlayer, matchingDimension ) if (hitPlayer == localPlayer) then createMarkers() destroyElement(source) end end addEventHandler ( "onClientMarkerHit", resourceRoot, MarkerHit ) Aftermath
Calculador Posted July 8, 2016 Posted July 8, 2016 First you destroy the blip and after the marker, test it. function createMarkers ( ) loc = math.random ( #markers ) marker = createMarker ( markers[loc][1], markers[loc][2], markers[loc][3], "cylinder", 5.0, 0, 0, 255, 150 ) blip = createBlipAttachedTo(marker, 41) end function MarkerHit ( hitPlayer, matchingDimension ) if (hitPlayer == localPlayer) then destroyElement(blip ) destroyElement(source) createMarkers() end end addEventHandler ( "onClientMarkerHit", resourceRoot, MarkerHit )
Walid Posted July 8, 2016 Posted July 8, 2016 how could i destroy the blip that was attached to the destroyed marker and attach a new blip to the new created marker again? Try this: local blips = {} function createMarkers ( ) loc = math.random ( #markers ) marker = createMarker ( markers[loc][1], markers[loc][2], markers[loc][3], "cylinder", 5.0, 0, 0, 255, 150 ) blips[marker] = createBlipAttachedTo(marker, 41) addEventHandler ( "onClientMarkerHit", marker, MarkerHit ) end function MarkerHit ( hitPlayer, matchingDimension ) if (hitPlayer == localPlayer) then if blips[source] then destroyElement(blips[source]) destroyElement(source) createMarkers() end end end Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Bean666 Posted July 8, 2016 Author Posted July 8, 2016 btw is it possible to trigger setElementVisibleTo from s-side to c-side? Aftermath
Walid Posted July 8, 2016 Posted July 8, 2016 btw is it possible to trigger setElementVisibleTo from s-side to c-side? Use the whole code server side. Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Bean666 Posted July 8, 2016 Author Posted July 8, 2016 btw i'm creating a marker and i have it on "corona", but it's creating a huge cylinder, even i change the size to 0 i used setMarkerSize , the size got small but the marker is so high , it's exceeding over the top. nvm fixed. Aftermath
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