Jump to content

markers


CapY

Recommended Posts

That doesn't make any sense.

addEventHandler("onClientRender", root, 
    function() 
        local px, py, pz = getElementPosition(getLocalPlayer()) 
        local x, y = getScreenFromWorldPosition(-1921.900, 536.816, 32.340) 
        if not x or not y then return end 
        local camX,camY,camZ = getCameraMatrix() 
         if not isLineOfSightClear ( camX , camY, camZ, px, py, pz, true, false, false, true, false, true, false, getLocalPlayer ( )) then return end 
        dxDrawText("LV", -1921.900, 536.816, 32.340,380.0,tocolor(255,255,255,255),2.0,"default","left","top",false,false,false) 
    end 
) 

Link to comment
  • Replies 73
  • Created
  • Last Reply

Top Posters In This Topic

oh lol

addEventHandler("onClientRender", root, 
    function() 
        local px, py, pz = getElementPosition(getLocalPlayer()) 
        local x, y = getScreenFromWorldPosition( px, py, pz ) 
        if not x or not y then return end 
        local camX,camY,camZ = getCameraMatrix() 
         if not isLineOfSightClear ( camX , camY, camZ, px, py, pz, true, false, false, true, false, true, false, getLocalPlayer ( )) then return end 
        dxDrawText("LV", x, y, x, y,tocolor(255,255,255,255),2.0,"default","left","top",false,false,false) 
    end 
) 

Link to comment
local x, y = getScreenFromWorldPosition(-1921.900, 536.816, 32.340) 
dxDrawText("LV", -1921.900, 536.816, 32.340,380.0,tocolor(255,255,255,255),2.0,"default","left","top",false,false,false) 

I don't know how, I didn't notice that.

Link to comment

Huh bad day , still dont working .

addEventHandler("onClientRender", root, 
    function() 
        local px, py, pz = getElementPosition(getLocalPlayer()) 
        local x, y = getScreenFromWorldPosition(-1921.900, 536.816, 32.340) 
        if not x or not y then return end 
        local camX,camY,camZ = getCameraMatrix() 
        if not isLineOfSightClear ( camX , camY, camZ, px, py, pz, true, false, false, true, false, true, false, getLocalPlayer ( )) then return end 
        dxDrawText("LV", -1921.900, 536.816, 32.340,380.0,tocolor(255,255,255,255),2.0,"default","left","top",false,false,false) 
    end 
) 
  

Link to comment
addEventHandler("onClientRender", root, 
    function() 
        local px, py, pz = getElementPosition(getLocalPlayer()) 
        local x, y = getScreenFromWorldPosition( px, py, pz ) 
        if not x or not y then return end 
        local camX,camY,camZ = getCameraMatrix() 
         if not isLineOfSightClear ( camX , camY, camZ, px, py, pz, true, false, false, true, false, true, false, getLocalPlayer ( )) then return end 
        dxDrawText("LV", x, y, x, y,tocolor(255,255,255,255),2.0,"default","left","top",false,false,false) 
    end 
) 

Link to comment
addEventHandler("onClientRender", root, 
    function() 
        local px, py, pz = getElementPosition(getLocalPlayer()) 
        local x, y = getScreenFromWorldPosition( px, py, pz + 1.2 , 0.06 ) 
        if not x or not y then return end 
        local camX,camY,camZ = getCameraMatrix() 
         if not isLineOfSightClear ( camX , camY, camZ, px, py, pz, true, false, false, true, false, true, false, getLocalPlayer ( )) then return end 
        dxDrawText("LV", x, y, x, y,tocolor(255,255,255,255),2.0) 
    end 
) 

Add debug messages.

Link to comment
  • 2 weeks later...

By the way .. i created a GUI, when player joins he have to press "LS" button and then he will got spawned on airport , i only have a GUI (because i dont know which functions i need)

addEventHandler("onClientResourceStart",resourceRoot, 
    function() 
        Window = {} 
        Button1 = {} 
  
        Window[1] = guiCreateWindow(0.7602,0.2939,0.2219,0.2373,"",true) 
        Button1[1] = guiCreateButton(0.088,0.6379,0.5106,0.2263,"LS",true,Window[1]) 
        guiSetVisible(Window[1],true) 
        showCursor(true) 
        addEventHandler("onClientGUIClick", Button1[1],function() 
        guiSetVisible(Window[1],false) 
        showCursor(false) 
        end,false) 
    end 
) 

Can i know which functions i need for GUI Teleport ?

Link to comment

So i created this :

Script:

addEventHandler("onClientResourceStart",resourceRoot, 
    function() 
        Window = {} 
        Button1 = {} 
  
        Window[1] = guiCreateWindow(0.7602,0.2939,0.2219,0.2373,"",true) 
        Button1[1] = guiCreateButton(0.088,0.6379,0.5106,0.2263,"LS",true,Window[1]) 
        guiSetVisible(Window[1],true) 
        showCursor(true) 
        addEventHandler("onClientGUIClick", Button1[1],function() 
        guiSetVisible(Window[1],false) 
        showCursor(false) 
        end,false) 
    end 
) 
  
  
  
function MarkerHit() -- define MarkerHit function for the handler 
    local elementType = getElementType() -- get the hit element's type 
    setElementPosition ( getLocalPlayer(), 1688.6726074219, 1428.3284912109, 30.770175933838 ) 
    addEventHandler("onClientGUIClick", Button1[1], MarketHit() 
end 
) 

Error on line 22 and 23.

Link to comment

Would be nice if you would read the debugscript, not just check the line number(s) and post them here.

addEventHandler("onClientResourceStart",resourceRoot, 
    function() 
        Window = {} 
        Button1 = {} 
  
        Window[1] = guiCreateWindow(0.7602,0.2939,0.2219,0.2373,"",true) 
        Button1[1] = guiCreateButton(0.088,0.6379,0.5106,0.2263,"LS",true,Window[1]) 
        guiSetVisible(Window[1],true) 
        showCursor(true) 
        addEventHandler("onClientGUIClick", Button1[1],function() 
        guiSetVisible(Window[1],false) 
        showCursor(false) 
        end,false) 
    end 
) 
  
  
  
function MarkerHit() -- define MarkerHit function for the handler 
    local elementType = getElementType() -- get the hit element's type 
    setElementPosition ( getLocalPlayer(), 1688.6726074219, 1428.3284912109, 30.770175933838 ) 
    addEventHandler("onClientGUIClick", Button1[1], MarketHit) 
end 

Link to comment

Why are you adding it twice, one close, and the other transport.

And getElementType without arguments.

addEventHandler("onClientResourceStart",resourceRoot, 
    function() 
        Window = {} 
        Button1 = {} 
  
        Window[1] = guiCreateWindow(0.7602,0.2939,0.2219,0.2373,"",true) 
        Button1[1] = guiCreateButton(0.088,0.6379,0.5106,0.2263,"LS",true,Window[1]) 
        showCursor(true) 
        addEventHandler("onClientGUIClick", Button1[1],MarkerHit ) 
    end 
) 
  
  
  
function MarkerHit() -- define MarkerHit function for the handler 
    setElementPosition ( getLocalPlayer(), 1688.6726074219, 1428.3284912109, 30.770175933838 ) 
end 
  

Link to comment
addEventHandler("onClientResourceStart",resourceRoot, 
    function() 
        Window = {} 
        Button1 = {} 
  
        Window[1] = guiCreateWindow(0.7602,0.2939,0.2219,0.2373,"",true) 
        Button1[1] = guiCreateButton(0.088,0.6379,0.5106,0.2263,"LS",true,Window[1]) 
        showCursor(true) 
        addEventHandler("onClientGUIClick", Button1[1],MarkerHit ) 
    end 
) 
  
  
  
function MarkerHit() -- define MarkerHit function for the handler 
    setElementPosition ( getLocalPlayer(), 1688.6726074219, 1428.3284912109, 30.770175933838 ) 
    guiSetVisible ( Window [ 1 ] , false ) 
    showCursor ( false ) 
end 

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