Jump to content

markers


CapY

Recommended Posts

Posted

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 
) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

  • Replies 73
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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 
) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted

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 
) 
  

Posted

This ?

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) 

Posted
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 
) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

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

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted

Just change px, py, pz to your cords.

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.

  • 2 weeks later...
Posted

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 ?

Posted

setElementPosition?

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

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.

Posted

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 

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

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 
  

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted
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 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted

One more bug , no matter where on the window i will click, i will get teleported and window will got closed , how to fix it ?

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