JR10 Posted August 25, 2011 Share Posted August 25, 2011 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
JR10 Posted August 30, 2011 Share Posted August 30, 2011 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
CapY Posted August 30, 2011 Author Share Posted August 30, 2011 Where was the difference ? Link to comment
JR10 Posted August 30, 2011 Share Posted August 30, 2011 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
CapY Posted August 30, 2011 Author Share Posted August 30, 2011 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
JR10 Posted August 30, 2011 Share Posted August 30, 2011 Did you just copy the same old code? Take the new one again. Link to comment
CapY Posted August 30, 2011 Author Share Posted August 30, 2011 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) Link to comment
JR10 Posted August 30, 2011 Share Posted August 30, 2011 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
CapY Posted September 1, 2011 Author Share Posted September 1, 2011 Forget, didnt worked Link to comment
CapY Posted September 1, 2011 Author Share Posted September 1, 2011 Lol just nothing... text is not there Link to comment
JR10 Posted September 1, 2011 Share Posted September 1, 2011 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
CapY Posted September 1, 2011 Author Share Posted September 1, 2011 Why you didnt put coords in ? Link to comment
JR10 Posted September 1, 2011 Share Posted September 1, 2011 Didn't? what do you mean? It gets the player's position, and draws a text. Link to comment
CapY Posted September 1, 2011 Author Share Posted September 1, 2011 Okay that's good too , now can you show dx text on some coords ? Default spawn for example. Link to comment
Castillo Posted September 1, 2011 Share Posted September 1, 2011 Just change px, py, pz to your cords. Link to comment
CapY Posted September 9, 2011 Author Share Posted September 9, 2011 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
CapY Posted September 9, 2011 Author Share Posted September 9, 2011 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
Castillo Posted September 9, 2011 Share Posted September 9, 2011 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
JR10 Posted September 9, 2011 Share Posted September 9, 2011 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
CapY Posted September 9, 2011 Author Share Posted September 9, 2011 It works , but GUI doesnt hide and Cursor is still there, why ? Link to comment
JR10 Posted September 9, 2011 Share Posted September 9, 2011 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
CapY Posted September 9, 2011 Author Share Posted September 9, 2011 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 ? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now