Jump to content

Problema con onClientGUIClick


Anzo

Recommended Posts

Tengo un problema con onClientGUIClick y es que, en vez de solo quitarle el dinero y darle el arma al jugador al precionar el boton, se le quita el dinero y le da el arma al precionar cualquier parte de la imagen/window.

El problema es que tengo un addEventHandler("onClientGUIClick", . . . , . . . ) dentro de una función, y en vez de darme el arma y quitarme dinero al precionar únicamente el botón ''botonComprarDeagle'', me quita dinero y me da el arma si le doy a cualquier parte de la imagen. Pondré los códigos donde se da click y el de la window.

-La imagen principal

function mainWindowD() 
    if source == WeaponMarker2 then 
    local money = getPlayerMoney(localPlayer) 
    local message = "Usa /centrar si tu resolución es mayor a 800x600" 
    local messageImportante = "No le des click otra vez al arma elegida para poder usar el panel sin errores." 
    local messageImportante2 = "En caso de que se te bugee el panel, cierralo y vuelve a entrar al marcador rojo" 
        mainDXimage = guiCreateStaticImage(0, 0, 900, 600, ":spawn/imgShop/button.png", false) 
        guiSetProperty(mainDXimage, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
        guiSetVisible(mainDXimage, true) 
        showCursor(true) 
        gray = guiCreateStaticImage(225, 75, 640, 430, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(gray, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
  
         
        NOMBRE_DE_LAS_ARMAS = guiCreateLabel(55, 51, 535, 32, "Elige una arma para comprar" , false, gray) 
        Informacion = guiCreateLabel(55, 80, 535, 32, ""..message.."" , false, gray) 
        informacionImportante = guiCreateLabel(55, 100, 535, 32, ""..messageImportante.."" , false, gray) 
        informacionImportante2 = guiCreateLabel(55, 115, 535, 32, ""..messageImportante2.."" , false, gray) 
        guiLabelSetColor(informacionImportante, 255,0,0) 
        guiLabelSetColor(informacionImportante2, 255,0,0) 
  
        grayInfos = guiCreateStaticImage(38, 75, 213, 430, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(grayInfos, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
       
        damageImagen = guiCreateStaticImage(18, 60, 57, 64, ":spawn/imgShop/Icon_damage.png", false, grayInfos) 
        damageLabel = guiCreateLabel(79, 75, 114, 42, "Daño:", false, grayInfos) 
         
        PrecisionImagen = guiCreateStaticImage(18, 136, 57, 64, ":spawn/imgShop/Icon_accuracy.png", false, grayInfos) 
        PrecisionLabel = guiCreateLabel(79, 158, 114, 42, "Presición:", false, grayInfos) 
        
        AQUI_VA_LA_PRECISION = guiCreateLabel(78, 189, 115, 21, "...", false, grayInfos) 
  
         
  
        RangImagen = guiCreateStaticImage(20, 229, 59, 70, ":spawn/imgShop/target_Icon.png", false, grayInfos) 
        RangTLabel = guiCreateLabel(85, 249, 118, 29, "Rango: ...", false, grayInfos) 
         
        ArmaRangoImagen = guiCreateStaticImage(20, 318, 59, 75, ":spawn/imgShop/Icon_range.png", false, grayInfos) 
        RangoArmaLabel = guiCreateLabel(79, 328, 120, 22, "Rango (arma):", false, grayInfos) 
        
        AQUI_VA_EL_RANGO = guiCreateLabel(82, 354, 111, 29, "...", false, grayInfos) 
         
  
        buttonMejoras = guiCreateStaticImage(264, 51, 124, 57, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(buttonMejoras, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
  
        MejorasLabel = guiCreateLabel(24, 19, 83, 20, "Mejoras", false, buttonMejoras) 
        local font7_fontmoney = guiCreateFont(":hud/font/fontmoney.ttf", 12) 
        guiSetFont(MejorasLabel, font7_fontmoney) 
  
        buttonVender = guiCreateStaticImage(398, 51, 124, 57, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(buttonVender, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
  
        VenderLabel = guiCreateLabel(24, 18, 100, 35, "Vender", false, buttonVender) 
        guiSetFont(VenderLabel, font7_fontmoney) 
  
        buttonMinigun = guiCreateStaticImage(54, 490, 116, 69, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(buttonMinigun, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
  
        minigunLabel = guiCreateLabel(37, 10, 35, 16, "Minigun", false, buttonMinigun) 
        guiSetFont(minigunLabel, "default-small") 
        minigunImage = guiCreateStaticImage(2, 10, 114, 68, ":hud/Armas/38.png", false, buttonMinigun) 
  
        labelsss = guiCreateLabel(395, 573, 286, 26, "", false, mainDXimage) 
        buttonRocketLauncherHS = guiCreateStaticImage(170, 490, 116, 69, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(buttonRocketLauncherHS, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
  
        RkcHS = guiCreateLabel(15, 10, 85, 15, "Rocket Launcher HS", false, buttonRocketLauncherHS) 
        guiSetFont(RkcHS, "default-small") 
        rocketLauncherHS = guiCreateStaticImage(10, 10, 93, 64, ":hud/Armas/36.png", false, buttonRocketLauncherHS) 
  
        buttonRocketNormal = guiCreateStaticImage(286, 490, 116, 69, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(buttonRocketNormal, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
  
        normalLabelRocket = guiCreateLabel(10, 10, 101, 15, "Rocket Launcher normal", false, buttonRocketNormal) 
        guiSetFont(normalLabelRocket, "default-small") 
        normalLauncher = guiCreateStaticImage(-4, 15, 126, 57, ":hud/Armas/35.png", false, buttonRocketNormal) 
  
        buttonLanzallamas = guiCreateStaticImage(402, 490, 116, 69, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(buttonLanzallamas, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
  
        lanzaLlamasLabel = guiCreateLabel(37, 6, 52, 15, "Lanzallamas", false, buttonLanzallamas) 
        guiSetFont(lanzaLlamasLabel, "default-small") 
        guiLabelSetColor(lanzaLlamasLabel, 243, 0, 0) 
        Lanzallamas = guiCreateStaticImage(-12, 10, 129, 62, ":hud/Armas/37.png", false, buttonLanzallamas) 
  
        buttonNoseCualEs = guiCreateStaticImage(518, 490, 116, 69, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(buttonNoseCualEs, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
  
        Knife_label = guiCreateLabel(40, 10, 25, 15, "Knife", false, buttonNoseCualEs) 
        guiSetFont(Knife_label, "default-small") 
        Knife = guiCreateStaticImage(-30, -30, 177, 145, ":hud/Armas/4.png", false, buttonNoseCualEs) 
  
        buttonTWHO = guiCreateStaticImage(634, 490, 116, 69, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(buttonTWHO, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
  
        Katana_label = guiCreateLabel(40, 10, 31, 15, "Katana", false, buttonTWHO) 
        guiSetFont(Katana_label, "default-small") 
        Katana = guiCreateStaticImage(-13, -4, 150, 96, ":hud/Armas/8.png", false, buttonTWHO) 
  
        desertEagleButton = guiCreateStaticImage(749, 490, 95, 69, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(desertEagleButton, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
  
        DesertEagle = guiCreateStaticImage(-21, 5, 133, 76, ":hud/Armas/24.png", false, desertEagleButton) 
        labelDesert = guiCreateLabel(18, 10, 63, 15, "Desert Eagle", false, desertEagleButton) 
        guiSetFont(labelDesert, "default-small") 
        guiLabelSetColor(labelDesert, 196, 245, 0) 
  
        labs2 = guiCreateLabel(579, 754, 15, 15, "", false, mainDXimage) 
        tuDineroButton = guiCreateStaticImage(532, 51, 230, 57, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(tuDineroButton, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
  
        tuDinero = guiCreateLabel( 20, 12, 247, 35, "Cerrar", false, tuDineroButton) 
        guiSetFont(tuDinero, font6_fontmoney) 
        clickInMinigun() 
    end 
end  
addEventHandler("onClientMarkerHit", getRootElement(), mainWindowD) 

-Al dar click

function clickInDesertIGEL() 
    if source == DesertEagle then 
        DeagleWep = guiCreateStaticImage(69, 50, 464, 291, ":hud/Armas/24.png", false, gray) 
        guiSetVisible(NOMBRE_DE_LAS_ARMAS, false) 
         
        DeagleNombre = guiCreateLabel(55, 51, 535, 32, "Desert Eagle", false, gray) 
         
        botonComprarDeagle = guiCreateStaticImage(220, 325, 170, 60, ":spawn/imgShop/button.png", false, gray) 
        guiSetProperty(botonComprarDeagle, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
        labelComprarDeagle = guiCreateLabel(10, 31, 78, 23, "Comprar", false, botonComprarDeagle) 
   
        precioDeagle = guiCreateLabel(10, 10, 150, 23, "$10.000 /Balas: 50", false, botonComprarDeagle) 
        
        guiLabelSetColor(precioDeagle, 0, 255, 12) 
         
         
        --Otra money 
        otherDeagle = guiCreateStaticImage(400, 325, 200, 60, ":spawn/imgShop/button.png", false, gray) 
        guiSetProperty(otherDeagle, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
        lblDeagle = guiCreateLabel(10, 31, 140, 23, "Comprar con tokens", false, otherDeagle) 
        
   
        precioDeagle2 = guiCreateLabel(10, 10, 150, 23, "$10.000 /Balas: 50", false, otherDeagle) 
     
        guiLabelSetColor(precioDeagle2, 0, 255, 12) 
        --Daño  
        guiSetVisible(damageLabel, false) 
        damageDeagle = guiCreateLabel(79, 75, 114, 42, "Daño: 30", false, grayInfos) 
        --Precision 
        guiSetVisible(AQUI_VA_LA_PRECISION,false) 
        accuracyDeagle = guiCreateLabel(78, 189, 115, 21, "1", false, grayInfos) 
        --Target_range 
        guiSetVisible(RangTLabel,false) 
        RangoDeagle = guiCreateLabel(85, 249, 118, 29, "Rango: ", false, grayInfos) 
        --Range minigun 
        guiSetVisible(AQUI_VA_EL_RANGO,false) 
        rangoDeagle = guiCreateLabel(79, 328, 120, 22, "Rango (arma):", false, grayInfos) 
        rangeMaxDeagle = guiCreateLabel(82, 354, 111, 29, "38", false, grayInfos)     
         --Disable minigun  
        guiSetVisible(minigunImagenMAIN,false) 
        guiSetVisible(minigunNombre,false) 
        guiSetVisible(botonComprarDX,false) 
        guiSetVisible(botonComprarDX2,false) 
        guiSetVisible(labelComprarDX,false) 
        guiSetVisible(labelComprarDX2,false) 
        guiSetVisible(precioDXLAB,false) 
        guiSetVisible(precioDXLAB2,false) 
        guiSetVisible(damageLabelMinigun,false) 
        guiSetVisible(MINIGUNaccuracy,false) 
        guiSetVisible(RangTMinigun,false) 
        guiSetVisible(RangoMinigunLabel,false) 
        guiSetVisible(minigunRangeMax,false) 
        --Disable Rocket Launcher HS 
        guiSetVisible(HSimageMain,false) 
        guiSetVisible(HSNombre,false) 
        guiSetVisible(botonCompraHS,false) 
        guiSetVisible(labelCompraHS,false) 
        guiSetVisible(precioHS,false) 
        guiSetVisible(HS2,false) 
        guiSetVisible(LblHS2,false) 
        guiSetVisible(HSprecioT,false) 
        guiSetVisible(damageHS,false) 
        guiSetVisible(HSaccuracy,false) 
        guiSetVisible(RangoHS,false) 
        guiSetVisible(rangeMaxHS,false) 
        guiSetVisible(rangoHSLabel,false) 
        --Disable lanzallamas 
        guiSetVisible(lanzallamasWeapn,false) 
        guiSetVisible(lanzaNombre,false) 
        guiSetVisible(botonComprarLanzallamas,false) 
        guiSetVisible(labelComprarLanzallamas,false) 
        guiSetVisible(precioLanzallamas,false) 
        guiSetVisible(otherLanzallamas,false) 
        guiSetVisible(precioLanzallamas,false) 
        guiSetVisible(damageFuego,false) 
        guiSetVisible(accuracyFuegos,false) 
        guiSetVisible(RangoFuego,false) 
        guiSetVisible(rangoNormalFuego,false) 
        guiSetVisible(rangeMaxFuego,false) 
        ---NORMAL 
        guiSetVisible(NormalNombre,false) 
        guiSetVisible(launcherNormal,false) 
        guiSetVisible(botonComprarDX2,false) 
        guiSetVisible(botonCompraNormal,false) 
        guiSetVisible(labelCompraNormal,false) 
        guiSetVisible(precioNormal,false) 
        guiSetVisible(otherNormal,false) 
        guiSetVisible(lblNormal,false) 
        guiSetVisible(precioTNrmal,false) 
        guiSetVisible(damageNormal,false) 
        guiSetVisible(accuracyNormal,false) 
        guiSetVisible(RangoNormal,false) 
        guiSetVisible(rangeMaxNormal,false) 
        --Knife disable 
        guiSetVisible(KnifeWep,false) 
        guiSetVisible(KnifeNombre,false) 
        guiSetVisible(botonComprarKnife,false) 
        guiSetVisible(labelComprarKnife,false) 
        guiSetVisible(precioKnife,false) 
        guiSetVisible(otherKnife,false) 
        guiSetVisible(lblKnife,false) 
        guiSetVisible(precioTNrmal,false) 
        guiSetVisible(damageKnife,false) 
        guiSetVisible(accuracyKnifes,false) 
        guiSetVisible(RangoKnife,false) 
        guiSetVisible(rangoKnife,false) 
        guiSetVisible(rangeMaxKnife,false) 
        --Katana disable 
        guiSetVisible(KatanaWep,false) 
        guiSetVisible(KatanaNombre,false) 
        guiSetVisible(botonComprarKatana,false) 
        guiSetVisible(labelComprarKatana,false) 
        guiSetVisible(precioKatana,false) 
        guiSetVisible(otherKatanas,false) 
        guiSetVisible(lblKatanas,false) 
        guiSetVisible(precioKatana2,false) 
        guiSetVisible(damageKatana,false) 
        guiSetVisible(accuracyKatana,false) 
        guiSetVisible(RangoKatana,false) 
        guiSetVisible(rangoKatana,false) 
        guiSetVisible(rangeMaxKatanas,false) 
        addEventHandler("onClientGUIClick", botonComprarDeagle, addWeaponDeagle) 
             
    end 
end 
addEventHandler("onClientGUIClick", root, clickInDesertIGEL) 

--Este es el trigger para que me de el arma y me quite el dinero.

function addWeaponDeagle() 
    triggerServerEvent("DeagleTakeMoney",localPlayer,player) 
end 

Quizá sea un error (aunque no creo que sea un error, creo que está mal hecho :S) tonto, pero antes nunca había tenido este problema con los botones, y no sé como solucionarlo.

Bueno, espero entiendan lo que digo y el código para que me puedan ayudar :roll:

Link to comment

Eso te pasa porque onClientGUIClick tiene como 'source' el botón que clickeas. Si pones root, defines a todo el panel como 'botón' o espacio donde clickear pues.

The source of this event is the GUI element that was clicked. 

PD: Deberías echarle un vistazo a la wiki...

Link to comment
Eso te pasa porque onClientGUIClick tiene como 'source' el botón que clickeas. Si pones root, defines a todo el panel como 'botón' o espacio donde clickear pues.

The source of this event is the GUI element that was clicked. 

PD: Deberías echarle un vistazo a la wiki...

Y... Cómo lo soluciono e_e?

Link to comment
addEventHandler("onClientGUIClick", boton_clickeado, clickInDesertIGEL) 

boton_clickeado haría referencia al botón al que, cuando le das click, realiza la función. ¿Entiendes?

Entonces le cambio el root por el nombre del boton? (no puedo probarlo ahora)

Link to comment
Nombre no es, es variable. Y sí.

Mala costumbre la mía de estar diciéndole nombre a las variables xD. Bueno, probé lo que me dijiste ayer pero ahora no me deja darle click al boton para que aparezca la imagen de la desert eagle y los botoner para comprar.

Dejare el código donde donde están las imágenes principales.

--Este es la parte cuando entras al marker y te aparece la window

function mainWindowD() 
    if source == WeaponMarker2 then 
    
        mainDXimage = guiCreateStaticImage(0, 0, 900, 600, ":spawn/imgShop/button.png", false) 
        guiSetProperty(mainDXimage, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
        guiSetVisible(mainDXimage, true) 
        showCursor(true) 
        --[[ 
        EL PROBLEMA ES QUE SI LE DOY A UNA PARTE DE 'gray' YA SEA UN POCO A LA DERECHA O UN POCO ARRIBA, ME QUITARA DINERO Y ME DARÁ EL ARMA. 
        Cuando debería quitarme el dinero y darme el arma cuando le doy al boton 'Desert Eagle' 
        --]] 
        gray = guiCreateStaticImage(225, 75, 640, 430, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(gray, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
         
        desertEagleButton = guiCreateStaticImage(749, 490, 95, 69, ":spawn/imgShop/button.png", false, mainDXimage) 
        guiSetProperty(desertEagleButton, "ImageColours", "tl:B4000000 tr:B4000000 bl:B4000000 br:B4000000") 
         
        ------------------ 
        --AL PRECIONAR EL BOTON DesertEagle, APARECERA LA IMAGEN Y LOS BOTONES PARA COMPRAR EN LA IMAGEN 'gray' 
        ----------------- 
        DesertEagle = guiCreateStaticImage(-21, 5, 133, 76, ":hud/Armas/24.png", false, desertEagleButton) 
        ----------- 
        labelDesert = guiCreateLabel(18, 10, 63, 15, "Desert Eagle", false, desertEagleButton) 
        guiSetFont(labelDesert, "default-small") 
        guiLabelSetColor(labelDesert, 196, 245, 0) 
  
    end 
end  
addEventHandler("onClientMarkerHit", getRootElement(), mainWindowD) 
  
--Y aquí es donde tengo la parte para que aparezcan los botones, la imagen de la desert en el gray, al precionar 'DesertEagle 
  
function clickInDesertIGEL() 
        DeagleWep = guiCreateStaticImage(69, 50, 464, 291, ":hud/Armas/24.png", false, gray) 
        guiSetVisible(NOMBRE_DE_LAS_ARMAS, false) 
         
        DeagleNombre = guiCreateLabel(55, 51, 535, 32, "Desert Eagle", false, gray) 
         
        botonComprarDeagle = guiCreateStaticImage(220, 325, 170, 60, ":spawn/imgShop/button.png", false, gray) 
        guiSetProperty(botonComprarDeagle, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
        labelComprarDeagle = guiCreateLabel(10, 31, 78, 23, "Comprar", false, botonComprarDeagle) 
   
        precioDeagle = guiCreateLabel(10, 10, 150, 23, "$10.000 /Balas: 50", false, botonComprarDeagle) 
        
        guiLabelSetColor(precioDeagle, 0, 255, 12) 
         
         
        --Otra money 
        otherDeagle = guiCreateStaticImage(400, 325, 200, 60, ":spawn/imgShop/button.png", false, gray) 
        guiSetProperty(otherDeagle, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
        lblDeagle = guiCreateLabel(10, 31, 140, 23, "Comprar con tokens", false, otherDeagle) 
        
   
        precioDeagle2 = guiCreateLabel(10, 10, 150, 23, "$10.000 /Balas: 50", false, otherDeagle) 
     
        guiLabelSetColor(precioDeagle2, 0, 255, 12) 
        --Daño  
        guiSetVisible(damageLabel, false) 
        damageDeagle = guiCreateLabel(79, 75, 114, 42, "Daño: 30", false, grayInfos) 
        --Precision 
        guiSetVisible(AQUI_VA_LA_PRECISION,false) 
        accuracyDeagle = guiCreateLabel(78, 189, 115, 21, "1", false, grayInfos) 
        --Target_range 
        guiSetVisible(RangTLabel,false) 
        RangoDeagle = guiCreateLabel(85, 249, 118, 29, "Rango: ", false, grayInfos) 
        --Range minigun 
        guiSetVisible(AQUI_VA_EL_RANGO,false) 
        rangoDeagle = guiCreateLabel(79, 328, 120, 22, "Rango (arma):", false, grayInfos) 
        rangeMaxDeagle = guiCreateLabel(82, 354, 111, 29, "38", false, grayInfos)     
         --Disable minigun  
        guiSetVisible(minigunImagenMAIN,false) 
        guiSetVisible(minigunNombre,false) 
        guiSetVisible(botonComprarDX,false) 
        guiSetVisible(botonComprarDX2,false) 
        guiSetVisible(labelComprarDX,false) 
        guiSetVisible(labelComprarDX2,false) 
        guiSetVisible(precioDXLAB,false) 
        guiSetVisible(precioDXLAB2,false) 
        guiSetVisible(damageLabelMinigun,false) 
        guiSetVisible(MINIGUNaccuracy,false) 
        guiSetVisible(RangTMinigun,false) 
        guiSetVisible(RangoMinigunLabel,false) 
        guiSetVisible(minigunRangeMax,false) 
        --Disable Rocket Launcher HS 
        guiSetVisible(HSimageMain,false) 
        guiSetVisible(HSNombre,false) 
        guiSetVisible(botonCompraHS,false) 
        guiSetVisible(labelCompraHS,false) 
        guiSetVisible(precioHS,false) 
        guiSetVisible(HS2,false) 
        guiSetVisible(LblHS2,false) 
        guiSetVisible(HSprecioT,false) 
        guiSetVisible(damageHS,false) 
        guiSetVisible(HSaccuracy,false) 
        guiSetVisible(RangoHS,false) 
        guiSetVisible(rangeMaxHS,false) 
        guiSetVisible(rangoHSLabel,false) 
        --Disable lanzallamas 
        guiSetVisible(lanzallamasWeapn,false) 
        guiSetVisible(lanzaNombre,false) 
        guiSetVisible(botonComprarLanzallamas,false) 
        guiSetVisible(labelComprarLanzallamas,false) 
        guiSetVisible(precioLanzallamas,false) 
        guiSetVisible(otherLanzallamas,false) 
        guiSetVisible(precioLanzallamas,false) 
        guiSetVisible(damageFuego,false) 
        guiSetVisible(accuracyFuegos,false) 
        guiSetVisible(RangoFuego,false) 
        guiSetVisible(rangoNormalFuego,false) 
        guiSetVisible(rangeMaxFuego,false) 
        ---NORMAL 
        guiSetVisible(NormalNombre,false) 
        guiSetVisible(launcherNormal,false) 
        guiSetVisible(botonComprarDX2,false) 
        guiSetVisible(botonCompraNormal,false) 
        guiSetVisible(labelCompraNormal,false) 
        guiSetVisible(precioNormal,false) 
        guiSetVisible(otherNormal,false) 
        guiSetVisible(lblNormal,false) 
        guiSetVisible(precioTNrmal,false) 
        guiSetVisible(damageNormal,false) 
        guiSetVisible(accuracyNormal,false) 
        guiSetVisible(RangoNormal,false) 
        guiSetVisible(rangeMaxNormal,false) 
        --Knife disable 
        guiSetVisible(KnifeWep,false) 
        guiSetVisible(KnifeNombre,false) 
        guiSetVisible(botonComprarKnife,false) 
        guiSetVisible(labelComprarKnife,false) 
        guiSetVisible(precioKnife,false) 
        guiSetVisible(otherKnife,false) 
        guiSetVisible(lblKnife,false) 
        guiSetVisible(precioTNrmal,false) 
        guiSetVisible(damageKnife,false) 
        guiSetVisible(accuracyKnifes,false) 
        guiSetVisible(RangoKnife,false) 
        guiSetVisible(rangoKnife,false) 
        guiSetVisible(rangeMaxKnife,false) 
        --Katana disable 
        guiSetVisible(KatanaWep,false) 
        guiSetVisible(KatanaNombre,false) 
        guiSetVisible(botonComprarKatana,false) 
        guiSetVisible(labelComprarKatana,false) 
        guiSetVisible(precioKatana,false) 
        guiSetVisible(otherKatanas,false) 
        guiSetVisible(lblKatanas,false) 
        guiSetVisible(precioKatana2,false) 
        guiSetVisible(damageKatana,false) 
        guiSetVisible(accuracyKatana,false) 
        guiSetVisible(RangoKatana,false) 
        guiSetVisible(rangoKatana,false) 
        guiSetVisible(rangeMaxKatanas,false) 
         
        addEventHandler("onClientGUIClick", botonComprarDeagle, addWeaponDeagle) 
     
end 
addEventHandler("onClientGUIClick", DesertEagle, clickInDesertIGEL) 

La parte de los guiSetVisible's es solo para que se eliminen las imagenes de las demás armas si ya estaba precionadas antes xD.

Necesito ayuda con esto para 'desbugear' el panel.

Link to comment

Esto:

addEventHandler("onClientGUIClick", DesertEagle, clickInDesertIGEL) 

Es lo mismo que:

addEventHandler("onClientGUIClick", botonComprarDeagle, addWeaponDeagle) 

PD: No entiendo tu código, pones los nombres de tus funciones a tu gusto, pero a nosotros nos puede llegar a confundir.

Link to comment
Esto:
addEventHandler("onClientGUIClick", DesertEagle, clickInDesertIGEL) 

Es lo mismo que:

addEventHandler("onClientGUIClick", botonComprarDeagle, addWeaponDeagle) 

PD: No entiendo tu código, pones los nombres de tus funciones a tu gusto, pero a nosotros nos puede llegar a confundir.

No te preocupes, que hasta a mi me confunde, por eso decidí volver a hacerlo, por que tenía demasiados bug's el código. Disculpa por esto, pero son cosas que pasan al hacer un código largo y no organizarlo bien :roll: , igualmente gracias.

De todas formas, si vuelvo a tener problemas con el onClientGUIClick, lo diré por aquí (aunque trataré de no tenerlos de nuevo, por que me doy cuenta que me traen muchos bug's).

Link to comment
  • Recently Browsing   0 members

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