dawid4157 Posted August 7, 2014 Share Posted August 7, 2014 Hy, I have problem with create GUI in MTA version 1.4.0. In logs I have this error: [2014-08-07 18:13:10] ERROR: FirstDC\server.lua:24: attempt to call global 'guiCreateWindow' (a nil value) How repair this? Code command: function firstGUI(player) oknoo = guiCreateWindow(43, 144, 712, 328, "Okienko", false) guiWindowSetSizable(oknoo, false) guiSetVisible ( oknoo, false ) end addCommandHandler("gui", firstGUI) Link to comment
dawid4157 Posted August 7, 2014 Author Share Posted August 7, 2014 (edited) I create file: guicommand.lua with this code: function firstGUI(player) outputChatBox("Powinno wyświetlić się ładne okienko GUI.", getRootElement(), 0, 255, 0) oknoo = guiCreateWindow(43, 144, 712, 328, "Okienko", false) guiWindowSetSizable(oknoo, false) guiSetVisible ( oknoo, false ) end addCommandHandler("gui", firstGUI) In meta.xml I ser this: <script src="guicommand.lua" type="client-side" /> And nothing. This erorr is all the time: [2014-08-07 18:13:10] ERROR: FirstDC\server.lua:24: attempt to call global 'guiCreateWindow' (a nil value) Where is a problem? Edited August 7, 2014 by Guest Link to comment
Gr0x Posted August 7, 2014 Share Posted August 7, 2014 <script src="guicommand.lua" type="client" /> Link to comment
dawid4157 Posted August 7, 2014 Author Share Posted August 7, 2014 Ok. Don`t errors after entering the type="client" but also don`t show GUI. Why? What is wrong? Link to comment
Et-win Posted August 7, 2014 Share Posted August 7, 2014 guiSetVisible ( oknoo, false ) guiSetVisible: Does it need to be visible? No = false and yes = true. So set it to true Also, you don't have to put the code there, because if you create it it is visible automatically. Link to comment
dawid4157 Posted August 7, 2014 Author Share Posted August 7, 2014 Ok. All is good. Thanks. I do not know why I did not notice this Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now