Jump to content

remove blip to player on hit marker


Thivenin

Recommended Posts

Posted

hai all, I again need help, this time is for a blip, I really don't know what to add :/

here is the script of the marker :

LMNBfirstMarker = createMarker ( -35, 14, 121.5, "arrow", 1.5, 250, 0, 250, 255 ) 
setElementInterior ( LMNBfirstMarker, 900 ) 
  
function LMNBfirstTP ( markerHit, matchingDimension ) 
    if ( markerHit == LMNBfirstMarker ) then 
    hitplayer = source 
        setElementInterior ( 903, 423, 247, 40 ) 
    end 
end 
addEventHandler ( "onPlayerMarkerHit", getRootElement(), LMNBfirstTP ) 

so I wanna remove the blip of the player who is hiting this marker, help me pls, I really don't know what to do, I'm a beginner in scripting ^^

Posted (edited)

This should do it, also what are you tryng to do with "setElementInterior ( 903, 423, 247, 40 )"

LMNBfirstMarker = createMarker ( -35, 14, 121.5, "arrow", 1.5, 250, 0, 250, 255 ) 
setElementInterior ( LMNBfirstMarker, 900 ) 
  
function LMNBfirstTP ( hitElement, matchingDimension ) -- the function 
if ( getElementType(hitElement) == "player" ) then -- if the hitted elemnt is a player  
setPlayerNametagShowing ( hitElement, false ) -- hide the nametag 
setElementInterior (hitElement, 903, 423, 247, 40 ) -- plox, your interior added 
for ElementKey, ElementValue in ipairs ( getAttachedElements (hitElement) ) do -- loop trough the attachElements which are attached on the player 
if ( getElementType ( ElementValue ) == "blip" ) then -- if it found a blip element then 
destroyElement ( ElementValue ) -- destroy the element 
end 
end 
end 
end 
addEventHandler ( "onMarkerHit", LMNBfirstMarker, LMNBfirstTP ) 
--changed from ""onPlayerMarkerHit", getRootElement()" to "onMarkerHit, LMNBfirstMarker", because it will trigger for all markers when you will use root, and the onPlayerMarkerHit is an old event 

Edited by Guest

Sometimes I dream about cheese

Posted

ty :))

with setElementInterior ( 903, 423, 247, 40 ) I just forgot "source" for TP the player there

edit : I added setElementInterior ( source, 903, 423, 247, 40 ) but it's not TPing + it's hiding the marker when I take it

and it's destroying my blip and show off my tag :) that is working, ty :)

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...