Jump to content

Make marker invisible, not working :s


DarkLink

Recommended Posts

Okay guys, hi there, I am with a little problem here.

I want to make a marker invisible, this marker is inside a interior.

I have this to get the marker from map file:

local xara = getElementByID("xara")

and then when player teleports to that checkpoint, I have this code:

setElementAlpha(xara,0)

All server side, and I dont have errors on console :S

Weird :S

Link to comment

Well I can also use that, but setElementAlpha should work :S

  
local xara = getElementByID("xara") 
local x,y,z = getElementPosition(xara) 
  
function teleporte (deliver, hitElement) 
  
    if(isElementWithinMarker(hitElement, entrada)) then 
        removePedFromVehicle(deliver) 
        setElementInterior( deliver, 6) 
        setTimer(setElementPosition, 500, 1, deliver, x, y, z + 1) 
        toggleControl( deliver, "enter_exit", true) 
        setElementAlpha(xara,0) 
    else 
        outputChatBox("car not in marker") 
    end 
end 
  

function is being called.. player is being teleporte to the marker, but marker is full opaque.. must be invisible if I put 0 on alpha argument :S

thanks jacob ;)

Link to comment

Its not working jacob, I tryed this:

  
setElementVisibleTo(xara,getRootElement(),false) 
  

but its not working , the marker is visible, i dont have any errors on console.

Should I create marker with visible to nil? instead of creating with visible to the root and then change its visibility to false for everyone...

Thanks!

EDIT:

I NOTICE this on wiki:

https://wiki.multitheftauto.com/wiki/SetMarkerSize

Setting negative value will "flip" the marker, do nothing or make it invisible:

..

..

So if I put a size negative will make the marker invisible?

ty

Link to comment
This function sets the alpha(transparency) value for the specified element. This can be a player or a vehicle.

But I saw DoomedSpaceMarine doing this somehow on objects in his snow script :S

Yes that is true, the last time I checked setElementAlpha worked on objects..

Link to comment

Thanks guys, Found my problem LOL!

I had on my map, 2 markers with same name, coords, colors, everything.. like a clone..

And when I was setting alpha 0 for that marker, the other marker was still there with alpha 255 xD

Now I delete one from the map file, and its working.

thanks ;)

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