Jump to content

Player blips


Recommended Posts

If you haven't enabled "playerblips" resource and you don't have them in your code, they're not in the game...

And name? Make a for loop for players and use "setNametagText" or something like that.

as regards to the playerblips its only for certain players that i want the blips to disapear,

so if u set namtag invisible then it wont show on the map?

Link to comment

Nametag visible on the MAP? How you did that...

Anyway, you can do setElementData on the player in when the blip is created, then when you want to make it disappear. You retrieve it, do destroyElement, and off the blip goes! (I think...)

EDIT: Oh lol, forgot about a better method:

function destroyBlipsAttachedTo(player) 
    local attached = getAttachedElements ( player ) 
    if ( attached ) then 
        for k,element in ipairs(attached) do 
            if getElementType ( element ) == "blip" then 
                destroyElement ( element ) 
            end 
        end 
    end 
end 

And add a command handler or anything to make it easy to aim for certain players.

Link to comment
  • 1 year later...

Blips are created but doesn't removed ...

col_blip = createColSphere ( -84.0570, -2765.6428, 69.9104, 400)
 
function create_blip (pla)
createBlip ( -307.2204, -2752.5786, 70.8629, 47, 1, pla )
createBlip ( -310.3098, -2857.3950, 41.0316, 47, 1, pla )
createBlip ( -76.7017, -2877.6662, 38.5667, 47, 1, pla )
createBlip ( 54.8855, -2651.9997, 39.4814, 47, 1, pla )
createBlip ( -50.3280, -2481.7639, 35.7425, 47, 1, pla )
createBlip ( -64.4422, -2580.7946, 70.466, 47, 1, pla )
createBlip ( -62.2048, -2740.3339, 73.025, 47, 1, pla )
end
addEventHandler ( "onColShapeHit", col_blip, create_blip )
 
function destroy_blip (pla)
local attached = getAttachedElements ( pla )
if ( attached ) then
	for k,element in ipairs(attached) do
		if getElementType ( element ) == "blip" then
			destroyElement ( element )
		end
	end
end
end
addEventHandler ( "onColShapeLeave", col_blip, destroy_blip )

Link to comment

May not be using the proposed feature ...

This should probably act, but I do not know why it does not want to ...

function destroy_blip (pla)
local blipsZ = getElementsByType( "blip" )
for i,elemetZ in ipairs(blipsZ) do
	if getElementID(elemetZ) == 47 then
		destroyElement(elemetZ)
	end
end
end
addEventHandler ( "onColShapeLeave", col_blip, destroy_blip )

Link to comment

thank you very much for your help

:wav::wav::wav:

now everything works as I wanted :lol:

but the console reports a warning :roll:

wornningblip.jpg

I attach this part of the script if someone will need use this

col_blip = createColSphere ( -84.0570, -2765.6428, 69.9104, 500)
 
function create_blip (pla)
createBlip ( -307.2204, -2752.5786, 70.8629, 47, 1, pla )
createBlip ( -310.3098, -2857.3950, 41.0316, 47, 1, pla )
createBlip ( -76.7017, -2877.6662, 38.5667, 47, 1, pla )
createBlip ( 54.8855, -2651.9997, 39.4814, 47, 1, pla )
createBlip ( -50.3280, -2481.7639, 35.7425, 47, 1, pla )
createBlip ( -64.4422, -2580.7946, 70.466, 47, 1, pla )
createBlip ( -62.2048, -2740.3339, 73.025, 47, 1, pla )
end
addEventHandler ( "onColShapeHit", col_blip, create_blip )
 
function destroy_blip (pla)
local blipsZ = getElementsByType( "blip" )
for i,elemetZ in ipairs(blipsZ) do
	if getBlipIcon(elemetZ) == 47 then
		destroyElement(elemetZ)
	end
end
 
end
addEventHandler ( "onColShapeLeave", col_blip, destroy_blip )

Link to comment

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