Jump to content

What's the problem with the 'wnd' in freeroam?


Turbe$Z

Recommended Posts

i tried create a window in freeroam, but doesn't working

---------------------------
-- Teszt
---------------------------


local GUIEditor = {
    button = {},
    window = {},
    label = {}
}

        wnd.GUIEditor.window[1] = guiCreateWindow(541, 375, 360, 222, "Teszt", false)
        guiWindowSetSizable(wnd.GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(10, 182, 340, 30, "teszt", false, GUIEditor.window[1])
        GUIEditor.label[1] = guiCreateLabel(9, 26, 341, 156, "- Teszt", false, GUIEditor.window[1])    
		guiSetVisible( wnd.GUIEditor.window[1], false )
		{'btn', id='gift', window=wnd.GUIEditor.window[1], width=250}

Error: gui.lua:283: attempt to index local 'wnd' (a userdata value)

what wrong? 

  • Like 1
Link to comment

wnd.GUIEditor.window[1]  = wnd?

 

wnd=?

 

I think you are trying to create a button in the freeroam and and when the player press it show the gui? which is  wnd.GUIEditor.window[1] ?

Then no need to use wnd because it's nil and makes no sense remove it and just use it normally 

from what i'm seeing that is line 15 and 16 you are creating a button and label to a non-existing window.

 

Just do it like this :

{ 'btn', id='gift', onclick=aCalledGiftFunction },

function aCalledGiftFunction ( 	)
	if guiGetVisible( element guiElement ) ~= true then
		guiSetVisible( element guiElement, bool state )
		showCursor( player thePlayer, bool show, [ bool toggleControls = true ] )
	end
end

 

Edited by FaHaD
  • Like 1
Link to comment
25 minutes ago, FaHaD said:

wnd.GUIEditor.window[1]  = wnd?

 

wnd=?

 

I think you are trying to create a button in the freeroam and and when the player press it show the gui? which is  wnd.GUIEditor.window[1] ?

Then no need to use wnd because it's nil and makes no sense remove it and just use it normally 

from what i'm seeing that is line 15 and 16 you are creating a button and label to a non-existing window.

 

Just do it like this :


{ 'btn', id='gift', onclick=aCalledGiftFunction },


function aCalledGiftFunction ( 	)
		guiSetVisible( element guiElement, bool state )
		showCursor( bool show, [ bool toggleControls = true ] )
	end

 

Thanks man!:D

  • Like 1
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...