Jump to content

Gui help plz


SnoopCat

Recommended Posts

Gui Help

hey i have this gui and i want to put Something that if you press F5 it gets opened and when u put the CERRAR button it get colsed

and also i want to put the butons to play a sound when u push them.

here is gui:

  
GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) 
GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Ayuwoky",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"Fail",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) 
GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) 
GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) 
GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) 
GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) 
GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) 
GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) 
GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) 
GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) 
guiSetFont(GUIEditor_Label[1],"sa-header") 
GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) 
  

Link to comment
GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) 
GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Ayuwoky",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"Fail",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) 
GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) 
GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) 
GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) 
GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) 
GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) 
GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) 
GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) 
GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) 
guiSetFont(GUIEditor_Label[1],"sa-header") 
GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) 
  
addEventHandler("onClientGUIClick",getRootElement(), 
function () 
if (source == GUIEditor_Button[13]) then 
guiSetVisible(GUIEditor_Window[1],false) 
showCursor(false) 
  end 
end) 

Link to comment
GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) 
guiSetVisible(GUIEditor_Window[1],false) 
GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Ayuwoky",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"Fail",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) 
GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) 
GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) 
GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) 
GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) 
GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) 
GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) 
GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) 
GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) 
guiSetFont(GUIEditor_Label[1],"sa-header") 
GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) 
  
addEventHandler("onClientGUIClick",getRootElement(), 
function () 
if (source == GUIEditor_Button[13]) then 
guiSetVisible(GUIEditor_Window[1],false) 
showCursor(false) 
elseif (source == GUIEditor_Button[2]) then 
for i,v in pairs(getElementsByType("player")) do 
playSound("fail.mp3",false) 
end 
elseif (source == GUIEditor_Button[3]) then 
for i,v in pairs(getElementsByType("player")) do 
playSound("fail2.mp3",false) 
    end 
  end 
end) 
  
bindKey("F5","down",function () showCursor(not isCursorShowing()) guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) end) 

Try that.

Edited by Guest
Link to comment
GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) 
guiSetVisible(GUIEditor_Window[1],false) 
GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Ayuwoky",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"Fail",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) 
GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) 
GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) 
GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) 
GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) 
GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) 
GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) 
GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) 
GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) 
guiSetFont(GUIEditor_Label[1],"sa-header") 
GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) 
  
addEventHandler("onClientGUIClick",getRootElement(), 
function () 
if (source == GUIEditor_Button[13]) then 
guiSetVisible(GUIEditor_Window[1],false) 
showCursor(false) 
  end 
end) 
function show() 
showCursor(true) 
guiSetVisible(GUIEditor_Window[1], true) 
end 
bindKey("F5","down", show) 

Link to comment
  
GUIEditor_Window = {} 
    GUIEditor_TabPanel = {} 
    GUIEditor_Tab = {} 
    GUIEditor_Button = {} 
    GUIEditor_Label = {} 
    GUIEditor_Image = {} 
      
    GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) 
    guiSetVisible(GUIEditor_Window[1],false) 
    GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Ayuwoky",false,GUIEditor_Window[1]) 
    GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"Fail",false,GUIEditor_Window[1]) 
    GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) 
    GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) 
    GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) 
    GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) 
    GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) 
    GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) 
    GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) 
    GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) 
    GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) 
    GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) 
    GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) 
    GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) 
    GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
    GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) 
    guiLabelSetColor(GUIEditor_Label[1],255,255,255) 
    guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") 
    guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) 
    guiSetFont(GUIEditor_Label[1],"sa-header") 
    GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) 
      
    addEventHandler("onClientGUIClick",getRootElement(), 
    function () 
    if (source == GUIEditor_Button[13]) then 
    guiSetVisible(GUIEditor_Window[1],false) 
    showCursor(false) 
    elseif (source == GUIEditor_Button[2]) 
    for i,v in pairs(getElementsByType("player")) do 
    playSound("fail.mp3",false) 
        end 
      end 
    end) 
      
    bindKey("F5","down",function () showCursor(not isCursorShowing()) guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) end) 

Link to comment
    GUIEditor_Window = {} 
    GUIEditor_TabPanel = {} 
    GUIEditor_Tab = {} 
    GUIEditor_Button = {} 
    GUIEditor_Label = {} 
    GUIEditor_Image = {} 
      
    GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) 
    guiSetVisible(GUIEditor_Window[1],false) 
    GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Ayuwoky",false,GUIEditor_Window[1]) 
    GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"Fail",false,GUIEditor_Window[1]) 
    GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) 
    GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) 
    GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) 
    GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) 
    GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) 
    GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) 
    GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) 
    GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) 
    GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) 
    GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) 
    GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) 
    GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) 
    GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
    GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) 
    guiLabelSetColor(GUIEditor_Label[1],255,255,255) 
    guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") 
    guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) 
    guiSetFont(GUIEditor_Label[1],"sa-header") 
    GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) 
      
addEventHandler("onClientGUIClick",getRootElement(), 
function () 
if (source == GUIEditor_Button[13]) then 
guiSetVisible(GUIEditor_Window[1],false) 
showCursor(false) 
elseif (source == GUIEditor_Button[2]) then 
for i,v in pairs(getElementsByType("player")) do 
playSound("fail.mp3",false) 
end 
   end 
end) 
      
bindKey("F5","down",function () showCursor(not isCursorShowing()) guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) end) 

Link to comment

try this

  
  
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), 
function() 
    bindKey ( "F5", "down",  
        function(   ) 
            if (guiGetVisible(GUIEditor_Window[1]) == false) then 
                 setWindow() 
                 showCursor(true) 
                 elseif (guiGetVisible(GUIEditor_Window[1]) == true) then 
                guiSetVisible(GUIEditor_Window[1],false) 
                showCursor(false) 
            end 
        end) 
end) 
  
  
function setWindow() 
GUIEditor_Window = {} 
    GUIEditor_TabPanel = {} 
    GUIEditor_Tab = {} 
    GUIEditor_Button = {} 
    GUIEditor_Label = {} 
    GUIEditor_Image = {} 
      
    GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) 
    GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Ayuwoky",false,GUIEditor_Window[1]) 
    GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"Fail",false,GUIEditor_Window[1]) 
    GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) 
    GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) 
    GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) 
    GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) 
    GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) 
    GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) 
    GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) 
    GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) 
    GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) 
    GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) 
    GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) 
    GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) 
    GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
    GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) 
    guiLabelSetColor(GUIEditor_Label[1],255,255,255) 
    guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") 
    guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) 
    guiSetFont(GUIEditor_Label[1],"sa-header") 
    GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) 
end 
  
addEventHandler("onClientGUIClick",getRootElement(), 
function () 
if (source == GUIEditor_Button[13]) then 
guiSetVisible(GUIEditor_Window[1],false) 
showCursor(false) 
elseif (source == GUIEditor_Button[2]) then 
playSound("fail.mp3",false) 
   end 
end) 
  
  

Link to comment
try this
  
  
addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), 
function() 
    bindKey ( "F5", "down",  
        function(   ) 
            if (guiGetVisible(GUIEditor_Window[1]) == false) then 
                 setWindow() 
                 showCursor(true) 
                 elseif (guiGetVisible(GUIEditor_Window[1]) == true) then 
                guiSetVisible(GUIEditor_Window[1],false) 
                showCursor(false) 
            end 
        end) 
end) 
  
  
function setWindow() 
GUIEditor_Window = {} 
    GUIEditor_TabPanel = {} 
    GUIEditor_Tab = {} 
    GUIEditor_Button = {} 
    GUIEditor_Label = {} 
    GUIEditor_Image = {} 
      
    GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) 
    GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Ayuwoky",false,GUIEditor_Window[1]) 
    GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"Fail",false,GUIEditor_Window[1]) 
    GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) 
    GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) 
    GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) 
    GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) 
    GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) 
    GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) 
    GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) 
    GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) 
    GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) 
    GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) 
    GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) 
    GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) 
    GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
    GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) 
    guiLabelSetColor(GUIEditor_Label[1],255,255,255) 
    guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") 
    guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) 
    guiSetFont(GUIEditor_Label[1],"sa-header") 
    GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) 
end 
  
addEventHandler("onClientGUIClick",getRootElement(), 
function () 
if (source == GUIEditor_Button[13]) then 
guiSetVisible(GUIEditor_Window[1],false) 
showCursor(false) 
elseif (source == GUIEditor_Button[2]) then 
playSound("fail.mp3",false) 
   end 
end) 
  
  

Volk-rus, what is this? why you did write this if it was already fixed? my code was even simplier/less code, i won't offend you but, he should use my code instead.

Link to comment

Ok, i suposed it wasn't going to work that way, now, you will need to create a server-side script too.

--server side

addEvent("sendSound",true) 
addEventHandler("sendSound",getRootElement(), 
function (sound) 
triggerClientEvent("returnSound",getRootElement(),sound) 
outputChatBox("#FF0000".. getPlayerName(source) .."#FFFF00 has played a sound!",getRootElement(),255,255,0,true) 
end) 

--client side

    GUIEditor_Window = {} 
    GUIEditor_TabPanel = {} 
    GUIEditor_Tab = {} 
    GUIEditor_Button = {} 
    GUIEditor_Label = {} 
    GUIEditor_Image = {} 
      
    GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) 
    guiSetVisible(GUIEditor_Window[1],false) 
    GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Ayuwoky",false,GUIEditor_Window[1]) 
    GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"Fail",false,GUIEditor_Window[1]) 
    GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) 
    GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) 
    GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) 
    GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) 
    GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) 
    GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) 
    GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) 
    GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) 
    GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) 
    GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) 
    GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) 
    GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) 
    GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
    GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) 
    guiLabelSetColor(GUIEditor_Label[1],255,255,255) 
    guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") 
    guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) 
    guiSetFont(GUIEditor_Label[1],"sa-header") 
    GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) 
      
addEventHandler("onClientGUIClick",getRootElement(), 
function () 
if (source == GUIEditor_Button[13]) then 
guiSetVisible(GUIEditor_Window[1],false) 
showCursor(false) 
elseif (source == GUIEditor_Button[2]) then 
triggerServerEvent("sendSound",getLocalPlayer(),"fail.mp3") 
   end 
end) 
  
addEvent("returnSound",true) 
addEventHandler("returnSound",getRootElement(), 
function (sound) 
playSound(tostring(sound),false) 
end) 
      
bindKey("F5","down",function () showCursor(not isCursorShowing()) guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) end) 

It should work fine (not tested).

Link to comment
    enabled = true 
  
    GUIEditor_Window = {} 
    GUIEditor_TabPanel = {} 
    GUIEditor_Tab = {} 
    GUIEditor_Button = {} 
    GUIEditor_Label = {} 
    GUIEditor_Image = {} 
      
    GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) 
    guiSetVisible(GUIEditor_Window[1],false) 
    GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Ayuwoky",false,GUIEditor_Window[1]) 
    GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"Fail",false,GUIEditor_Window[1]) 
    GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) 
    GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) 
    GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) 
    GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) 
    GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) 
    GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) 
    GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) 
    GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) 
    GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) 
    GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) 
    GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) 
    GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) 
    GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
    GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) 
    guiLabelSetColor(GUIEditor_Label[1],255,255,255) 
    guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") 
    guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) 
    guiSetFont(GUIEditor_Label[1],"sa-header") 
    GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) 
      
addEventHandler("onClientGUIClick",getRootElement(), 
function () 
if (source == GUIEditor_Button[13]) then 
guiSetVisible(GUIEditor_Window[1],false) 
showCursor(false) 
elseif (source == GUIEditor_Button[2]) then 
if enabled then 
triggerServerEvent("sendSound",getLocalPlayer(),"fail.mp3") 
enabled = false 
setTimer(setState,60000,1) 
else 
outputChatBox("You can use this once 1 minute.",255,0,0) 
end 
   end 
end) 
  
function setState() 
enabled = true 
end 
  
addEvent("returnSound",true) 
addEventHandler("returnSound",getRootElement(), 
function (sound) 
playSound(tostring(sound),false) 
end) 
      
bindKey("F5","down",function () showCursor(not isCursorShowing()) guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) end) 

Link to comment

Ah, i found my error, i didn't put the folder, so the sounds can't be played because they doesn't exist at root directory, here's the fixed code.

--client side

enabled = true 
  
GUIEditor_Window = {} 
GUIEditor_TabPanel = {} 
GUIEditor_Tab = {} 
GUIEditor_Button = {} 
GUIEditor_Label = {} 
GUIEditor_Image = {} 
      
GUIEditor_Window[1] = guiCreateWindow(150,185,457,363,"Gui De Sonidos",false) 
guiSetVisible(GUIEditor_Window[1],false) 
GUIEditor_Button[1] = guiCreateButton(21,32,99,35,"Fail",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(19,79,102,34,"ayuwoki",false,GUIEditor_Window[1]) 
GUIEditor_Button[3] = guiCreateButton(20,130,100,33,"Hola",false,GUIEditor_Window[1]) 
GUIEditor_Button[4] = guiCreateButton(18,177,100,34,"Boton1",false,GUIEditor_Window[1]) 
GUIEditor_Button[5] = guiCreateButton(19,219,100,34,"Boton2",false,GUIEditor_Window[1]) 
GUIEditor_Button[6] = guiCreateButton(21,261,100,34,"Boton3",false,GUIEditor_Window[1]) 
GUIEditor_Button[7] = guiCreateButton(133,32,100,34,"Boton4",false,GUIEditor_Window[1]) 
GUIEditor_Button[8] = guiCreateButton(134,79,100,34,"Boton5",false,GUIEditor_Window[1]) 
GUIEditor_Button[9] = guiCreateButton(133,128,100,34,"Boton6",false,GUIEditor_Window[1]) 
GUIEditor_Button[10] = guiCreateButton(133,178,100,34,"Boton7",false,GUIEditor_Window[1]) 
GUIEditor_Button[11] = guiCreateButton(131,226,100,34,"Boton8",false,GUIEditor_Window[1]) 
GUIEditor_Button[12] = guiCreateButton(131,270,100,34,"Boton9",false,GUIEditor_Window[1]) 
GUIEditor_Button[13] = guiCreateButton(9,309,435,45,"CERRAR",false,GUIEditor_Window[1]) 
GUIEditor_TabPanel[1] = guiCreateTabPanel(35,-668,5,600,false,GUIEditor_Window[1]) 
GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) 
GUIEditor_Label[1] = guiCreateLabel(271,37,165,257,"No agas Spam ",false,GUIEditor_Window[1]) 
guiLabelSetColor(GUIEditor_Label[1],255,255,255) 
guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") 
guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) 
guiSetFont(GUIEditor_Label[1],"sa-header") 
GUIEditor_Image[1] = guiCreateStaticImage(243,134,204,120,"images/mtalogo.png",false,GUIEditor_Window[1]) 
      
addEventHandler("onClientGUIClick",getRootElement(), 
function () 
if (source == GUIEditor_Button[13]) then 
guiSetVisible(GUIEditor_Window[1],false) 
showCursor(false) 
elseif (source == GUIEditor_Button[1]) then 
if enabled then 
triggerServerEvent("sendSound",getLocalPlayer(),"Fail.mp3") 
enabled = false 
setTimer(setState,60000,1) 
else 
outputChatBox("Solo Puedes Hacerlo cada 60 Segundos",255,0,0) 
end 
   end 
end) 
  
function setState() 
enabled = true 
end 
  
addEvent("returnSound",true) 
addEventHandler("returnSound",getRootElement(), 
function (sound) 
playSound("files/".. tostring(sound),false) 
end) 
      
bindKey("F7","down",function () showCursor(not isCursorShowing()) guiSetVisible(GUIEditor_Window[1], not guiGetVisible(GUIEditor_Window[1])) end) 

--server side

addEvent("sendSound",true) 
addEventHandler("sendSound",getRootElement(), 
function (sound) 
triggerClientEvent("returnSound",getRootElement(),sound) 
outputChatBox("#FF0000".. getPlayerName(source) .."#FFFF00 Ha Usado un Sonido De la Gui [F7]",getRootElement(),255,255,0,true) 
end) 

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