Jump to content

GUI login system [problems]


Recommended Posts

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

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

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