Jump to content

What here not so?


alekseu788

Recommended Posts

GUI = { 
  window = {}, 
  button = {}, 
  edit = {} 
} 
  
function gui() 
  GUI.window[1] = guiCreateWindow(6, 340, 160, 105, "Автосалон",false) 
  GUI.button[1] = guiCreateButton(6, 40, 160, 100, "Купить",false,GUI.window[1]) 
  GUI.edit[1] = guiCreateEdit(6.45, 60, 160, 100, "10000",false,GUI.window[1]) 
  GUI.button[2] = guiCreateButton(6, 20, 160, 100, "Продать",false,GUI.window[1]) 
  guiSetVisible(GUI.window[1], false) 
  end 
  addEventHandler("onClientResourceStart", resourceRoot, gui) 
   
  function viewGui() 
  guiSetVisible(GUI.window[1], false, not guiSetVisible(GUI.window[1])) 
  showCursor(not isCursorShowing()) 
  end 
   
  addCommandHandler ("salon", viewGui) 

Link to comment

Try this:

local GUI = { window = {}, button = {}, edit = {} }; 
local guiv = false; 
  
addEventHandler("onClientResourceStart", resourceRoot, function() 
    GUI.window[1] = guiCreateWindow(6, 340, 160, 105, "Автосалон",false) 
    GUI.button[1] = guiCreateButton(6, 40, 160, 100, "Купить",false,GUI.window[1]) 
    GUI.edit[1] = guiCreateEdit(6.45, 60, 160, 100, "10000",false,GUI.window[1]) 
    GUI.button[2] = guiCreateButton(6, 20, 160, 100, "Продать",false,GUI.window[1]) 
    guiSetVisible(GUI.window[1], false) 
end); 
  
addCommandHandler("salon", function() 
    if (guiv == false) then 
        guiSetVisible(GUI.window[1], true); 
        showCursor(true); 
        guiv = true; 
    else 
        guiSetVisible(GUI.window[1], false); 
        showCursor(false); 
        guiv = false; 
    end 
end); 

Link to comment

Help please error again! What to do?

[2015-10-29 17:02:40] Resource '7avtosalon' changed, reloading and starting 
[2015-10-29 17:02:40] Starting 7avtosalon 
[2015-10-29 17:02:40] startResource: Resource '7avtosalon' started 
[2015-10-29 17:02:40] ADMIN: Resource '7avtosalon' started by TOPBASS 
[2015-10-29 17:02:45] ERROR: 7avtosalon\server.lua:14: attempt to call global 'guiSetVisible' (a nil value) 
[2015-10-29 17:06:08] Resources: 222 loaded, 0 failed 
[2015-10-29 17:06:15] ADMIN: Resource '7avtosalon' restarted by TOPBASS 
[2015-10-29 17:06:15] Stopping 7avtosalon 
[2015-10-29 17:06:15] Resource '7avtosalon' changed, reloading and starting 
[2015-10-29 17:06:15] Starting 7avtosalon 
[2015-10-29 17:06:15] 7avtosalon restarted successfully 
[2015-10-29 17:06:23] ERROR: 7avtosalon\client.lua:14: attempt to call global 'guiSetVisible' (a nil value) 

Link to comment

How to add open command ?

GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function () 
        GUIEditor.window[1] = guiCreateWindow(214, 230, 600, 458, "*Взять оружие*", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 1.00) 
  
        GUIEditor.button[1] = guiCreateButton(22, 390, 191, 50, "Взять Glock 19", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.button[1], "clear-normal") 
        GUIEditor.button[2] = guiCreateButton(391, 390, 191, 50, "Взять KRISS Vector", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.button[2], "clear-normal") 
        GUIEditor.staticimage[1] = guiCreateStaticImage(39, 38, 520, 332, "Png/logo2.png", false, GUIEditor.window[1]) 
        GUIEditor.button[3] = guiCreateButton(563, -78523, 15, 768, "", false, GUIEditor.window[1]) 
        GUIEditor.button[4] = guiCreateButton(253, 406, 99, 24, "Закрыть", false, GUIEditor.window[1]) 
end 

Link to comment

Try this:

GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {} 
} 
  
addCommandHandler ( "openpanel", 
    function () 
        GUIEditor.window[1] = guiCreateWindow(214, 230, 600, 458, "*Взять оружие*", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 1.00) 
  
        GUIEditor.button[1] = guiCreateButton(22, 390, 191, 50, "Взять Glock 19", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.button[1], "clear-normal") 
        GUIEditor.button[2] = guiCreateButton(391, 390, 191, 50, "Взять KRISS Vector", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.button[2], "clear-normal") 
        GUIEditor.staticimage[1] = guiCreateStaticImage(39, 38, 520, 332, "Png/logo2.png", false, GUIEditor.window[1]) 
        GUIEditor.button[3] = guiCreateButton(563, -78523, 15, 768, "", false, GUIEditor.window[1]) 
        GUIEditor.button[4] = guiCreateButton(253, 406, 99, 24, "Закрыть", false, GUIEditor.window[1]) 
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...