Jump to content

destroy blip?


Bean666

Recommended Posts

Posted

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

Posted

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 ) 
  
  

33lypu1.png

Posted
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

Posted
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

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...