Jump to content

Warp Position


iSmokee

Recommended Posts

Hola yo hice un panel que en un label tengo X, Y, Z y al lado de esas letras un edit box lo que yo quisiera hacer es que en los edit box en la X ponga la posicion x del mundo de gta sa y en la y lo mismo y en la z lo mismo y en un botón donde dice warp position que me lleve a la posicion que escribi en los edit box me dijieron que use setElementPosition y guiGetText pero lo intente y hasta ahora me da error me lleva al cielo del gta sa y empieza a caer el ped no entiendo porque alguien me podría ayudar gracias lo agradecería mucho.

Link to comment
  
function panel() 
        window = guiCreateWindow(203, 172, 388, 214, "[Warp] Position", false) 
        guiWindowSetSizable(window, false) 
        showCursor (true) 
       local positionxgtasa = guiCreateEdit(27, 25, 351, 31,"", false, window) 
       local positionygtasa = guiCreateEdit(28, 76, 350, 31, "", false, window) 
       local positionzgtasa = guiCreateEdit(27, 127, 351, 31,"" , false, window) 
        warp = guiCreateButton(9, 169, 284, 35, "Warp to Position Word GTA:SA", false, window) 
        guiSetProperty(warp, "NormalTextColour", "FFAAAAAA") 
        sair = guiCreateButton(303, 168, 75, 36, "Exit Panel", false, window) 
        guiSetProperty(sair, "NormalTextColour", "FFAAAAAA") 
        warpxgtasa = guiCreateLabel(10, 28, 15, 18, "X:", false, window) 
        warpygtasa = guiCreateLabel(12, 79, 15, 18, "Y:", false, window) 
        warpzgtasa = guiCreateLabel(12, 132, 15, 18, "Z:", false, window) 
  
            addEventHandler("onClientGUIClick",sair,cancelar) 
            addEventHandler("onClientGUIClick",warp,gotowarp) 
end 
addCommandHandler("warpos",panel) 
function cancelar() 
    destroyElement(window) 
    showCursor(false) 
end 
--function warptoword() 
        --local x,y,z = getElementPosition( positionxgtasa,positionygtasa,positionzgtasa ) 
--end 
function gotowarp ( source, posX, posY, posZ ) 
        setElementPosition ( .. guiGetText  ( positionxgtasa,positionygtasa,positionzgtasa )    getLocalPlayer(), posX, posY, posZ ) 
end 
  

Link to comment
Haz algo como esto:

 

  
local x, y, z = guiGetText(positionxgtasa), guiGetText(positionygtasa), guiGetText(positionzgtasa) 
  
setElementPosition(getLocalPlayer(), x, y, z) 

no no sirver no me anda y lo que yo quiero es que cuando apreté el botón me lleve a la pocicion que puse en el edit box

eso quiero

Link to comment
Déjame ver cómo pones el código ahora.
  
function panel() 
        window = guiCreateWindow(203, 172, 388, 214, "[Warp] Position", false) 
        guiWindowSetSizable(window, false) 
        showCursor (true) 
        positionxgtasa = guiCreateEdit(27, 25, 351, 31,"", false, window) 
        positionygtasa = guiCreateEdit(28, 76, 350, 31, "", false, window) 
        positionzgtasa = guiCreateEdit(27, 127, 351, 31,"" , false, window) 
        warp = guiCreateButton(9, 169, 284, 35, "Warp to Position Word GTA:SA", false, window) 
        guiSetProperty(warp, "NormalTextColour", "FFAAAAAA") 
        sair = guiCreateButton(303, 168, 75, 36, "Exit Panel", false, window) 
        guiSetProperty(sair, "NormalTextColour", "FFAAAAAA") 
        warpxgtasa = guiCreateLabel(10, 28, 15, 18, "X:", false, window) 
        warpygtasa = guiCreateLabel(12, 79, 15, 18, "Y:", false, window) 
        warpzgtasa = guiCreateLabel(12, 132, 15, 18, "Z:", false, window) 
  
            addEventHandler("onClientGUIClick",sair,cancelar) 
            addEventHandler("onClientGUIClick",warp,gotowarp) 
end 
addCommandHandler("warpos",panel) 
function cancelar() 
    destroyElement(window) 
    showCursor(false) 
end 
  
    local x, y, z = guiGetText(positionxgtasa), guiGetText(positionygtasa), guiGetText(positionzgtasa) 
function gotowarp() 
        setElementPosition(getLocalPlayer(), x, y, z) 
end 
  

yo quiero que cuando aprete el boton me lleve a la posicion del X,Y,Z

Link to comment

Prueba así:

function panel() 
        window = guiCreateWindow(203, 172, 388, 214, "[Warp] Position", false) 
        guiWindowSetSizable(window, false) 
        showCursor (true) 
        positionxgtasa = guiCreateEdit(27, 25, 351, 31,"", false, window) 
        positionygtasa = guiCreateEdit(28, 76, 350, 31, "", false, window) 
        positionzgtasa = guiCreateEdit(27, 127, 351, 31,"" , false, window) 
        warp = guiCreateButton(9, 169, 284, 35, "Warp to Position Word GTA:SA", false, window) 
        guiSetProperty(warp, "NormalTextColour", "FFAAAAAA") 
        sair = guiCreateButton(303, 168, 75, 36, "Exit Panel", false, window) 
        guiSetProperty(sair, "NormalTextColour", "FFAAAAAA") 
        warpxgtasa = guiCreateLabel(10, 28, 15, 18, "X:", false, window) 
        warpygtasa = guiCreateLabel(12, 79, 15, 18, "Y:", false, window) 
        warpzgtasa = guiCreateLabel(12, 132, 15, 18, "Z:", false, window) 
  
            addEventHandler("onClientGUIClick",sair,cancelar) 
            addEventHandler("onClientGUIClick",warp,gotowarp) 
end 
addCommandHandler("warpos",panel) 
function cancelar() 
    destroyElement(window) 
    showCursor(false) 
end 
  
function gotowarp() 
 local x, y, z = guiGetText(positionxgtasa), guiGetText(positionygtasa), guiGetText(positionzgtasa) 
        setElementPosition(getLocalPlayer(), x, y, z) 
end 

Link to comment
Prueba así:
function panel() 
        window = guiCreateWindow(203, 172, 388, 214, "[Warp] Position", false) 
        guiWindowSetSizable(window, false) 
        showCursor (true) 
        positionxgtasa = guiCreateEdit(27, 25, 351, 31,"", false, window) 
        positionygtasa = guiCreateEdit(28, 76, 350, 31, "", false, window) 
        positionzgtasa = guiCreateEdit(27, 127, 351, 31,"" , false, window) 
        warp = guiCreateButton(9, 169, 284, 35, "Warp to Position Word GTA:SA", false, window) 
        guiSetProperty(warp, "NormalTextColour", "FFAAAAAA") 
        sair = guiCreateButton(303, 168, 75, 36, "Exit Panel", false, window) 
        guiSetProperty(sair, "NormalTextColour", "FFAAAAAA") 
        warpxgtasa = guiCreateLabel(10, 28, 15, 18, "X:", false, window) 
        warpygtasa = guiCreateLabel(12, 79, 15, 18, "Y:", false, window) 
        warpzgtasa = guiCreateLabel(12, 132, 15, 18, "Z:", false, window) 
  
            addEventHandler("onClientGUIClick",sair,cancelar) 
            addEventHandler("onClientGUIClick",warp,gotowarp) 
end 
addCommandHandler("warpos",panel) 
function cancelar() 
    destroyElement(window) 
    showCursor(false) 
end 
Gracias -- s:D -->
  
function gotowarp() 
 local x, y, z = guiGetText(positionxgtasa), guiGetText(positionygtasa), guiGetText(positionzgtasa) 
        setElementPosition(getLocalPlayer(), x, y, z) 
end 

Link to comment

Nunca pude hacer una GUI dentro de función, siempre me dieron problema, aunque tuvieran variable local o variable global (creo que se llamaba así) me dieron error, intenta eliminar la función y agrega un guiSetVisible porque se ejecutará al descargar el script si no tiene una función.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...