dawid4157 Posted August 7, 2014 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)
Et-win Posted August 7, 2014 Posted August 7, 2014 GUI is client-side only. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
dawid4157 Posted August 7, 2014 Author 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
dawid4157 Posted August 7, 2014 Author Posted August 7, 2014 Ok. Don`t errors after entering the type="client" but also don`t show GUI. Why? What is wrong?
Et-win Posted August 7, 2014 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. ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
dawid4157 Posted August 7, 2014 Author Posted August 7, 2014 Ok. All is good. Thanks. I do not know why I did not notice this
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