Crosshair Posted May 23, 2012 Share Posted May 23, 2012 Hello. I own a sa:mp server, but recently i got an idea to make a mta server. I run in some problems. I created a gui wih Qt Designer, created the files, but when i try to execute with the command gui i`m getting attempt to call global 'guiGetScreenSize' (a nil value) Another question that i have is how i can make so that the gui runs when i enter the game ? How can i call functions from other lua files ? meta.xml http://pastebin.com/UyMynQEy linkmania.lua - main file http://pastebin.com/nM6pUm2X build.lua - gui itself http://pastebin.com/nbvFHPsv login.lua script for gui http://pastebin.com/5qL2sJRm Thanks in advance Link to comment
Castillo Posted May 23, 2012 Share Posted May 23, 2012 That's because you set your scripts as server side, but GUI is client side only. There, type="server" must be type="client" ( only for the GUI scripts of course ). Link to comment
Crosshair Posted May 23, 2012 Author Share Posted May 23, 2012 wow. thank god. is working. What about the other two questions ? 1. how i can make so that the gui runs when i enter the game ? 2. How can i call functions from other lua files ? Link to comment
Alpha Posted May 23, 2012 Share Posted May 23, 2012 I'm not good at this, but I will try my best. When you enter a server, you download all client sided files in a resource running on that server, after downloading them, they start. So if you just created a GUI using QT, took the code and added it to a client side script, in a resource and ran that resource, when you enter the server you will get that GUI. A way to hide the GUI is using the function: guiSetVisible 2. If the other lua file is in the same resource and the same side (server side or client side) and it's global (not localized), you can call it easily the same way you call a function in the same file. --serverscript.lua (Server sided script in a resource): function myFunction() --code end --serverscript2.lua (Another server sided script in the same resource): myFunction() If the other file is different side you can use: triggerServerEvent triggerClientEvent If it's other resource, you can use exports: call Also check: viewtopic.php?f=148&t=40809 Link to comment
Crosshair Posted May 23, 2012 Author Share Posted May 23, 2012 Thanks Alpha. Any help is good for me now I appreciate the help. I with try it tomorrow and see if it works. 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