Jump to content

[HELP]Guieditor


Gallagher

Recommended Posts

what error?

Just this appearing tabpanel.kit "kit aa", because the other tab does not appear

my code

  
function vip() 
    triggerServerEvent ( "ClientHaveLevel", getLocalPlayer() ) 
end 
  
addCommandHandler ("vip", vip) 
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), vip ) 
  
function armavip () 
showCursor (true) 
triggerServerEvent ( "onGreeting", getLocalPlayer() ) 
  
end 
  
function armavipsniper () 
showCursor (true) 
triggerServerEvent ( "onGreeting4", getLocalPlayer() ) 
  
end 
  
function equipvip () 
showCursor (true) 
triggerServerEvent ( "onGreeting2", getLocalPlayer() ) 
  
end 
  
function equipvipchezh () 
showCursor (true) 
triggerServerEvent ( "onGreeting5", getLocalPlayer() ) 
  
end 
  
function carr () 
showCursor (true) 
triggerServerEvent ( "onGreeting3", getLocalPlayer() ) 
  
end 
  
function tire () 
showCursor (true) 
triggerServerEvent ( "onGreeting6", getLocalPlayer() ) 
  
end 
  
local tabpanel = {} 
  
function vip2() 
  
window = guiCreateWindow(0.29, 0.18, 0.46, 0.68, "", true) 
        guiWindowSetSizable(window, false) 
showCursor ( true ) 
        logo = guiCreateStaticImage(0.06, 0.83, 0.90, 0.13, "images/radio.png", true,window) 
        close = guiCreateButton(430, 26, 25, 25, "X", false,window) 
        guiSetFont(close, "default-bold-small") 
        guiSetProperty(close, "NormalTextColour", "FF960000")     
         
       tabpanel.mytab = guiCreateTabPanel(0.10, 0.09, 0.80, 0.69, true,window) 
       tabpanel.kit = guiCreateTab("KIT aa",tabpanel.mytab) 
  
        fundoarmas = guiCreateStaticImage(-26, -37, 427, 403, "images/FUNDO.png", false, tabpanel.kit) 
        guiSetProperty(fundoarmas, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
         
        label1 = guiCreateLabel(0.24, 0.32, 0.16, 0.09, "  M4A1 \n  50 z$", true,fundoarmas) 
        guiSetFont(label1, "default-bold-small") 
      imgm4 = guiCreateStaticImage(0.11, 0.14, 0.31, 0.15, "images/m4a1.png", true,fundoarmas) 
  
      label2 = guiCreateLabel(0.71, 0.32, 0.16, 0.09, " CZ550 \n  90 z$", true,fundoarmas) 
        guiSetFont(label2, "default-bold-small") 
          
        img.sniper = guiCreateStaticImage(0.59, 0.14, 0.33, 0.15, "images/sniper.png", true,fundoarmas) 
     ---------------------- 
      
        tabpanel.itens = guiCreateTab("KIT ITENS",tabpanel.mytab) 
  
        fundoitens = guiCreateStaticImage(-31, -14, 447, 365, "images/FUNDO.png", false, tabpanel.itens) 
        guiSetProperty(fundoitens, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
  
        img.coyote = guiCreateStaticImage(0.13, 0.12, 0.26, 0.28, "images/coyote.png", true, fundoitens) 
        img.chezh = guiCreateStaticImage(0.63, 0.12, 0.26, 0.30, "images/chezh.png", true, fundoitens) 
        label.coyote = guiCreateLabel(0.22, 0.43, 0.22, 0.10, "COYOTE \n   60Z$", true, fundoitens) 
        guiSetFont(label.coyote, "default-bold-small") 
        label.chezh = guiCreateLabel(0.71, 0.43, 0.22, 0.10, "CHEZH\n  60Z$", true, fundoitens) 
        guiSetFont(label.chezh, "default-bold-small") 
  
        tab.mecanico = guiCreateTab("KIT MECÂNICO",tab) 
  
        fundo.mecanico = guiCreateStaticImage(-7, -7, 393, 352, "images/FUNDO.png", false, tab.mecanico) 
        guiSetProperty(fundo.mecanico, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
  
        img.engine = guiCreateStaticImage(0.11, 0.14, 0.27, 0.29, "images/engine.png", true, fundo.mecanico) 
        img.tire = guiCreateStaticImage(0.63, 0.14, 0.25, 0.30, "images/wheel.png", true, fundo.mecanico) 
        label.engine = guiCreateLabel(0.20, 0.45, 0.25, 0.12, "ENGINE \n 31 Z$", true, fundo.mecanico) 
        guiSetFont(label.engine, "default-bold-small") 
        label.tire = guiCreateLabel(0.71, 0.45, 0.25, 0.12, "TIRE \n31 Z$", true, fundo.mecanico) 
        guiSetFont(label.tire, "default-bold-small") 
  
        tab.survivor = guiCreateTab("CREDITOS",tab) 
  
        fundo.creditos = guiCreateStaticImage(-18, -14, 408, 358, "images/FUNDO.png", false, tab.survivor) 
        guiSetProperty(fundo.creditos, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
  
       texto.creditos = guiCreateMemo(0.14, 0.23, 0.76, 0.53, "--xD", true, fundo.creditos) 
        guiMemoSetReadOnly(texto.creditos, true) 
  
         
  
    addEvent( "showvip",true ) 
    addEventHandler ( "onClientGUIClick", imgm4, armavip, false ) 
    addEventHandler ( "onClientGUIClick", img.sniper, armavipsniper, false ) 
    addEventHandler ( "onClientGUIClick", img.coyote, equipvip, false ) 
    addEventHandler ( "onClientGUIClick", img.chezh, equipvipchezh, false ) 
    addEventHandler ( "onClientGUIClick", img.engine, carr, false ) 
    addEventHandler ( "onClientGUIClick", img.tire, tire, false ) 
    playSound("button.mp3") 
    addEventHandler ( "onClientGUIClick", close, 
    function() 
        guiSetVisible(window, false) 
        showCursor(false) 
    end, false ) 
end 
  
addEvent( "ShowVipPanel", true ) 
addEventHandler( "ShowVipPanel", getRootElement(), vip2) 
  
  

Edited by Guest
Link to comment

I don't know where'd you look for errors, but when I executed "vip2" function the debugscript shown many errors.

function vip() 
    triggerServerEvent ( "ClientHaveLevel", getLocalPlayer() ) 
end 
  
addCommandHandler ("vip", vip) 
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), vip ) 
  
function armavip () 
showCursor (true) 
triggerServerEvent ( "onGreeting", getLocalPlayer() ) 
  
end 
  
function armavipsniper () 
showCursor (true) 
triggerServerEvent ( "onGreeting4", getLocalPlayer() ) 
  
end 
  
function equipvip () 
showCursor (true) 
triggerServerEvent ( "onGreeting2", getLocalPlayer() ) 
  
end 
  
function equipvipchezh () 
showCursor (true) 
triggerServerEvent ( "onGreeting5", getLocalPlayer() ) 
  
end 
  
function carr () 
showCursor (true) 
triggerServerEvent ( "onGreeting3", getLocalPlayer() ) 
  
end 
  
function tire () 
showCursor (true) 
triggerServerEvent ( "onGreeting6", getLocalPlayer() ) 
  
end 
  
local tabpanel = {} 
  
function vip2() 
    label = { } 
    img = { } 
    tab = { } 
    fundo = { } 
    texto = { } 
  
    window = guiCreateWindow(0.29, 0.18, 0.46, 0.68, "", true) 
    guiWindowSetSizable(window, false) 
    showCursor ( true ) 
    logo = guiCreateStaticImage(0.06, 0.83, 0.90, 0.13, "images/radio.png", true,window) 
    close = guiCreateButton(430, 26, 25, 25, "X", false,window) 
    guiSetFont(close, "default-bold-small") 
    guiSetProperty(close, "NormalTextColour", "FF960000")     
        
    tabpanel.mytab = guiCreateTabPanel(0.10, 0.09, 0.80, 0.69, true,window) 
    tabpanel.kit = guiCreateTab("KIT aa",tabpanel.mytab) 
  
    fundoarmas = guiCreateStaticImage(-26, -37, 427, 403, "images/FUNDO.png", false, tabpanel.kit) 
    guiSetProperty(fundoarmas, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
        
    label1 = guiCreateLabel(0.24, 0.32, 0.16, 0.09, "  M4A1 \n  50 z$", true,fundoarmas) 
    guiSetFont(label1, "default-bold-small") 
    imgm4 = guiCreateStaticImage(0.11, 0.14, 0.31, 0.15, "images/m4a1.png", true,fundoarmas) 
  
    label2 = guiCreateLabel(0.71, 0.32, 0.16, 0.09, " CZ550 \n  90 z$", true,fundoarmas) 
    guiSetFont(label2, "default-bold-small") 
          
    img.sniper = guiCreateStaticImage(0.59, 0.14, 0.33, 0.15, "images/sniper.png", true,fundoarmas) 
     ---------------------- 
      
    tabpanel.itens = guiCreateTab("KIT ITENS",tabpanel.mytab) 
  
    fundoitens = guiCreateStaticImage(-31, -14, 447, 365, "images/FUNDO.png", false, tabpanel.itens) 
    guiSetProperty(fundoitens, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
  
    img.coyote = guiCreateStaticImage(0.13, 0.12, 0.26, 0.28, "images/coyote.png", true, fundoitens) 
    img.chezh = guiCreateStaticImage(0.63, 0.12, 0.26, 0.30, "images/chezh.png", true, fundoitens) 
    label.coyote = guiCreateLabel(0.22, 0.43, 0.22, 0.10, "COYOTE \n   60Z$", true, fundoitens) 
    guiSetFont(label.coyote, "default-bold-small") 
    label.chezh = guiCreateLabel(0.71, 0.43, 0.22, 0.10, "CHEZH\n  60Z$", true, fundoitens) 
    guiSetFont(label.chezh, "default-bold-small") 
  
    tab.mecanico = guiCreateTab("KIT MECÂNICO",tab) 
  
    fundo.mecanico = guiCreateStaticImage(-7, -7, 393, 352, "images/FUNDO.png", false, tab.mecanico) 
    guiSetProperty(fundo.mecanico, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
    img.engine = guiCreateStaticImage(0.11, 0.14, 0.27, 0.29, "images/engine.png", true, fundo.mecanico) 
    img.tire = guiCreateStaticImage(0.63, 0.14, 0.25, 0.30, "images/wheel.png", true, fundo.mecanico) 
    label.engine = guiCreateLabel(0.20, 0.45, 0.25, 0.12, "ENGINE \n 31 Z$", true, fundo.mecanico) 
    guiSetFont(label.engine, "default-bold-small") 
    label.tire = guiCreateLabel(0.71, 0.45, 0.25, 0.12, "TIRE \n31 Z$", true, fundo.mecanico) 
    guiSetFont(label.tire, "default-bold-small") 
  
    tab.survivor = guiCreateTab("CREDITOS",tab) 
  
    fundo.creditos = guiCreateStaticImage(-18, -14, 408, 358, "images/FUNDO.png", false, tab.survivor) 
    guiSetProperty(fundo.creditos, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
  
    texto.creditos = guiCreateMemo(0.14, 0.23, 0.76, 0.53, "--xD", true, fundo.creditos) 
    guiMemoSetReadOnly(texto.creditos, true) 
  
    addEvent( "showvip",true ) 
    addEventHandler ( "onClientGUIClick", imgm4, armavip, false ) 
    addEventHandler ( "onClientGUIClick", img.sniper, armavipsniper, false ) 
    addEventHandler ( "onClientGUIClick", img.coyote, equipvip, false ) 
    addEventHandler ( "onClientGUIClick", img.chezh, equipvipchezh, false ) 
    addEventHandler ( "onClientGUIClick", img.engine, carr, false ) 
    addEventHandler ( "onClientGUIClick", img.tire, tire, false ) 
    playSound("button.mp3") 
    addEventHandler ( "onClientGUIClick", close, 
    function() 
        guiSetVisible(window, false) 
        showCursor(false) 
    end, false ) 
end 
  
addEvent( "ShowVipPanel", true ) 
addEventHandler( "ShowVipPanel", getRootElement(), vip2) 

Link to comment
I don't know where'd you look for errors, but when I executed "vip2" function the debugscript shown many errors.
function vip() 
    triggerServerEvent ( "ClientHaveLevel", getLocalPlayer() ) 
end 
  
addCommandHandler ("vip", vip) 
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), vip ) 
  
function armavip () 
showCursor (true) 
triggerServerEvent ( "onGreeting", getLocalPlayer() ) 
  
end 
  
function armavipsniper () 
showCursor (true) 
triggerServerEvent ( "onGreeting4", getLocalPlayer() ) 
  
end 
  
function equipvip () 
showCursor (true) 
triggerServerEvent ( "onGreeting2", getLocalPlayer() ) 
  
end 
  
function equipvipchezh () 
showCursor (true) 
triggerServerEvent ( "onGreeting5", getLocalPlayer() ) 
  
end 
  
function carr () 
showCursor (true) 
triggerServerEvent ( "onGreeting3", getLocalPlayer() ) 
  
end 
  
function tire () 
showCursor (true) 
triggerServerEvent ( "onGreeting6", getLocalPlayer() ) 
  
end 
  
local tabpanel = {} 
  
function vip2() 
    label = { } 
    img = { } 
    tab = { } 
    fundo = { } 
    texto = { } 
  
    window = guiCreateWindow(0.29, 0.18, 0.46, 0.68, "", true) 
    guiWindowSetSizable(window, false) 
    showCursor ( true ) 
    logo = guiCreateStaticImage(0.06, 0.83, 0.90, 0.13, "images/radio.png", true,window) 
    close = guiCreateButton(430, 26, 25, 25, "X", false,window) 
    guiSetFont(close, "default-bold-small") 
    guiSetProperty(close, "NormalTextColour", "FF960000")     
        
    tabpanel.mytab = guiCreateTabPanel(0.10, 0.09, 0.80, 0.69, true,window) 
    tabpanel.kit = guiCreateTab("KIT aa",tabpanel.mytab) 
  
    fundoarmas = guiCreateStaticImage(-26, -37, 427, 403, "images/FUNDO.png", false, tabpanel.kit) 
    guiSetProperty(fundoarmas, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
        
    label1 = guiCreateLabel(0.24, 0.32, 0.16, 0.09, "  M4A1 \n  50 z$", true,fundoarmas) 
    guiSetFont(label1, "default-bold-small") 
    imgm4 = guiCreateStaticImage(0.11, 0.14, 0.31, 0.15, "images/m4a1.png", true,fundoarmas) 
  
    label2 = guiCreateLabel(0.71, 0.32, 0.16, 0.09, " CZ550 \n  90 z$", true,fundoarmas) 
    guiSetFont(label2, "default-bold-small") 
          
    img.sniper = guiCreateStaticImage(0.59, 0.14, 0.33, 0.15, "images/sniper.png", true,fundoarmas) 
     ---------------------- 
      
    tabpanel.itens = guiCreateTab("KIT ITENS",tabpanel.mytab) 
  
    fundoitens = guiCreateStaticImage(-31, -14, 447, 365, "images/FUNDO.png", false, tabpanel.itens) 
    guiSetProperty(fundoitens, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
  
    img.coyote = guiCreateStaticImage(0.13, 0.12, 0.26, 0.28, "images/coyote.png", true, fundoitens) 
    img.chezh = guiCreateStaticImage(0.63, 0.12, 0.26, 0.30, "images/chezh.png", true, fundoitens) 
    label.coyote = guiCreateLabel(0.22, 0.43, 0.22, 0.10, "COYOTE \n   60Z$", true, fundoitens) 
    guiSetFont(label.coyote, "default-bold-small") 
    label.chezh = guiCreateLabel(0.71, 0.43, 0.22, 0.10, "CHEZH\n  60Z$", true, fundoitens) 
    guiSetFont(label.chezh, "default-bold-small") 
  
    tab.mecanico = guiCreateTab("KIT MECÂNICO",tab) 
  
    fundo.mecanico = guiCreateStaticImage(-7, -7, 393, 352, "images/FUNDO.png", false, tab.mecanico) 
    guiSetProperty(fundo.mecanico, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
    img.engine = guiCreateStaticImage(0.11, 0.14, 0.27, 0.29, "images/engine.png", true, fundo.mecanico) 
    img.tire = guiCreateStaticImage(0.63, 0.14, 0.25, 0.30, "images/wheel.png", true, fundo.mecanico) 
    label.engine = guiCreateLabel(0.20, 0.45, 0.25, 0.12, "ENGINE \n 31 Z$", true, fundo.mecanico) 
    guiSetFont(label.engine, "default-bold-small") 
    label.tire = guiCreateLabel(0.71, 0.45, 0.25, 0.12, "TIRE \n31 Z$", true, fundo.mecanico) 
    guiSetFont(label.tire, "default-bold-small") 
  
    tab.survivor = guiCreateTab("CREDITOS",tab) 
  
    fundo.creditos = guiCreateStaticImage(-18, -14, 408, 358, "images/FUNDO.png", false, tab.survivor) 
    guiSetProperty(fundo.creditos, "ImageColours", "tl:FF000000 tr:FF000000 bl:FF000000 br:FF000000") 
  
    texto.creditos = guiCreateMemo(0.14, 0.23, 0.76, 0.53, "--xD", true, fundo.creditos) 
    guiMemoSetReadOnly(texto.creditos, true) 
  
    addEvent( "showvip",true ) 
    addEventHandler ( "onClientGUIClick", imgm4, armavip, false ) 
    addEventHandler ( "onClientGUIClick", img.sniper, armavipsniper, false ) 
    addEventHandler ( "onClientGUIClick", img.coyote, equipvip, false ) 
    addEventHandler ( "onClientGUIClick", img.chezh, equipvipchezh, false ) 
    addEventHandler ( "onClientGUIClick", img.engine, carr, false ) 
    addEventHandler ( "onClientGUIClick", img.tire, tire, false ) 
    playSound("button.mp3") 
    addEventHandler ( "onClientGUIClick", close, 
    function() 
        guiSetVisible(window, false) 
        showCursor(false) 
    end, false ) 
end 
  
addEvent( "ShowVipPanel", true ) 
addEventHandler( "ShowVipPanel", getRootElement(), vip2) 

you tested?

Appeared 4 tabs?

Link to comment
Not possible, because you can't attach an event client side to a server side function.

Value adding this function, and if the player does not have enough money to buy that message appear?

[sHOP] You do not have enough money to buy!

function sniper () 
   setElementData(source, "CZ 550", 1) 
   setElementData(source, "CZ 550 Mag", 120) 
   setElementData(source, "Hunting Knife", 1) 
  
  
end 
addEvent( "onGreeting4", true ) 
addEventHandler( "onGreeting4", getRootElement(), sniper ) 

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