Jump to content

local gui = {};


drk

Recommended Posts

I'm trying to make like this:

local gui = {}; 
  
gui['form'] = guiCreateWindow( ... ); 
  
guiSetVisible(gui['form'],false); 
  

But when I debugscript, and I use the variable gui['form'] I get like this: 'Bad argument @ guiSetVisible (bad argument 1, ...)'

When I use another variable like guiform or gui_form it work.

Why it happens?

Link to comment
It should work maybe you use not in client side.
local gui = { } 
gui['form'] = guiCreateWindow( "...",200,200,200,200,false ) 
guiSetVisible( gui['form'],false ) 
  

Aw, it client side. Now it working, I'm noob xD

More one question, why when I load a image it says that isn't UTF-8 and I get this error: 'gfx/images/closeh.png:1:unexpected symbol near '?'' and don't load... Why? .-. I'm using MTA 1.3 release.

Link to comment
  • Other Languages Moderators
H5N1 this is clientside. It doesn't matter if there is a local or not

doesn't matter if it was not inside any function

but if it was inside function and you want use it from another function you will have to make it global

Link to comment
H5N1 this is clientside. It doesn't matter if there is a local or not

doesn't matter if it was not inside any function

but if it was inside function and you want use it from another function you will have to make it global

That's what I'm talking about :D

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