Jump to content

Removing A Players Blip [HELP]


damien111

Recommended Posts

Posted (edited)

I need help creating a script that hides a players blip. so far the only thing i can do is remove the nametag. thanks in advance! Also can someone check my TaxiScript Post! Thanks

Edited by Guest
Posted

not understand anything at all

the subject say other thing and the topic itself say another thing

please explain better.

CiTLh.png
Posted

You want delete the blip or hide it?

You want the blip deleted/hidden for only who wrote the command or for all players?

This for delete

addCommandHandler("xxx", 
function() 
     for i,blip in ipairs(getElementsByType("blip")) do 
          destroyElement(blip) 
     end 
end) 

if you want it for only who wrote the command, put it client side.

if you want it for all players, put it server side.

CiTLh.png
Posted

I mean. I want to delete the blip of the player who's does the command , and it applys to everyone. So basicàlly I wanna hide the blip that marks the player.

Posted

Um, unless you use getAttachedElements, that's gonna kill every blip on the entire server, which is probably not a good thing.

Do NOT PM ME for help unless invited. - New MTA Script Editor

Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.

Posted
addCommandHandler ( "blip", 
    function ( thePlayer ) 
        for index, element in ipairs ( getAttachedElements ( thePlayer ) ) do 
            if ( getElementType ( element ) == "blip" ) then 
                destroyElement ( element ) 
            end 
        end 
    end 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
addCommandHandler ( "blip", 
    function ( thePlayer ) 
        for index, element in ipairs ( getAttachedElements ( thePlayer ) ) do 
            if ( getElementType ( element ) == "blip" ) then 
                setElementVisibleTo ( element, root, ( not isElementVisibleTo ( element ) ) ) 
            end 
        end 
    end 
) 

Not sure if that'll work though.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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