Jump to content

[HELP] - Window, Panel and Tab not Hide, pls Help me


carvalhos

Recommended Posts

hello, first of all thank you, I'm trying to write a script, my first scripts, I did a window pane and tabs and made a button to close the window, so it does not close, please look at the code:

maker.lua

marker1 = createMarker(-1943.8994140625, 702, 45.599998474121, "cylinder" , 2, 0, 0, 204, 200)

setMarkerColor(marker1, 237, 28, 36, 255 )

function markers(thePlayer)

if thePlayer == getLocalPlayer() then

local x, y, z = getElementPosition(thePlayer)

createObject(1655, x + 20 , y , z)

outputChatBox ( 'Object Created' , 255, 255, 0)

mainWindowl()

end

end

addEventHandler("onClientMarkerHit" , marker1, markers)

------------------

mainWindow.lua

function mainWindowl()

local janela = guiCreateWindow (0,0, 0.5, 0.9 , "Welcome to Server" , true)

local panel = guiCreateTabPanel (0, 0.1, 1, 0.8, true, janela)

local tab1 = guiCreateTab ("About MTCity" , panel)

local tab2 = guiCreateTab("Help" , panel)

local X = 0.70

local Y = 0.92

local L = 0.25

local A = 0.15

guiWindowSetMovable(janela, false)

guiWindowSetSizable(janela, false)

guiCreateLabel ( 0.02 , 0.04, 0.94, 0.2, "Bla BLa bla" , true, tab1)

guiCreateLabel (0.02, 0.04, 0.94, 0.92, "Ajuda Meu" , true, tab2)

showCursor(true)

btnOk = guiCreateButton (X, Y, L, A, "OK!" , true, janela)

addEventHandler("onClientGUIClick" , btnOk, funcOK, false)

end

function funcOK(button, state)

if button == "left" and state == "up" then

outputDebugString("entered if")

guiSetInputEnabled(false)

guiSetVisible(janela, false)

showCursor(false)

end

end

, please help me! thanks

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