Jump to content

[HELP]Mark open only in dimension 2


Black2

Recommended Posts

Hello i have this,he open in all dimensions how i put to open only in dimension 2 ? Thx

function Pilotjob(hitElement) 
             if getElementType(hitElement) == "player" and (hitElement == localPlayer) then 
                  if not guiGetVisible(Wnd) then 
                       guiSetVisible(Wnd, true) 
                       showCursor(true) 
                  end 
             end 
        end 
addEventHandler("onClientMarkerHit", markerp, Pilotjob) 

Link to comment

The event 'onClientMarkerHit' have two arguments, first one is hitElement and the second is matchingDimension.

You can use getElementDimension to get player current dimension.

You can do a simple if statement between getElementDimension and matchingDimension to make gui-window open only when a player is in specific dimension. :)

Link to comment

If you still don't know how to do it with Perfect his post:

function Pilotjob(hitElement, matchingDimension) 
             if getElementType(hitElement) == "player" and (hitElement == localPlayer) and (getElementDimension(hitElement) == matchingDimension) then 
                  if not guiGetVisible(Wnd) then 
                       guiSetVisible(Wnd, true) 
                       showCursor(true) 
                  end 
             end 
        end 
addEventHandler("onClientMarkerHit", markerp, Pilotjob) 

Your marker must be in dimension 2.

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