Jump to content

setElementVisibleTo bad argument again? :s


DarkLink

Recommended Posts

Another function giving me bad argument, why this happens so many times guys?

And always seems thats everything okay ..

look my code:

  
function teleport(hitElement) 
     
    if (getElementType(hitElement) == "player") then 
        local blip = getElementAttachedTo( hitElement ) 
        setTimer(verifica, 2000, 1, source, hitElement) 
         
        if(getPlayerTeam(hitElement) == team_immigrantsSP) then 
             
            setElementVisibleTo ( blip, getRootElement(), true ) 
        end 
        end 
  

okay so I already have a blip attached to this player (hitElement) and want to change is visibility when the player hits the marker.

and want to set is visibility to all players, so I use > getRootElement()

And I get this error on console:

bad argument @ 'setElementVisibleTo'

I would appreciate some help, I am getting these errors too frequently, and dont know how to fix them when everything seems okay :S

Thanks!

Link to comment
This function determines the element that the specified element is attached to.

player in not attached to a blip, blip is attached to player, so uou need to use

getAttachedElements 

this function returns a table

Thanks alot bro, that was my problem, didnt notice :x

Really thanks , u always helping me too ;)

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