This is the clientside code:
localPlayer = getLocalPlayer()
wnd_window = {}
addEventHandler( "onClientLogin", getResourceRootElement( getThisResource() ),
function ( theResource )
--outputConsole( "wnd_showServerInfo called" )
--outputConsole( " source: ".. tostring( source ) )
--outputConsole( " resourceStarted: ".. tostring( theResource ) )
if source == getResourceRootElement( theResource ) then
--outputConsole( " passed if: source == resource" )
local xml = xmlLoadFile( "server.xml" )
local contents = xmlNodeGetValue( xml )
wnd_create( "Ablakgeci", "logo.png", contents )
end
end
)
function wnd_close()
guiSetVisible( wnd_window.wnd, false )
showCursor( false )
end
addEvent( "window_text", true )
function wnd_create( title, logo, content )
--outputConsole( "wnd_create called" )
if not wnd_window.wnd then
--outputConsole( " passed if" )
wnd_window.wnd = guiCreateWindow( 0.1, 0.15, 0.8, 0.7, title, true )
guiWindowSetSizable( wnd_window.wnd, false )
guiWindowSetMovable( wnd_window.wnd, false )
wnd_window.logo = guiCreateStaticImage( 0.01, 0.035, 0.98, 0.25, logo, true, wnd_window.wnd )
--wnd_window.text = content
wnd_window.memo = guiCreateMemo( 0, 0.3, 1, .6, content, true, wnd_window.wnd )
guiMemoSetReadOnly( wnd_window.memo, true )
wnd_window.close_btn = guiCreateButton( 0, .91, .3, 1, "Bezar", true, wnd_window.wnd )
--outputConsole( " window created: ".. tostring( wnd_window.wnd ) )
showCursor( true )
addEventHandler( "onClientGUIClick", wnd_window.close_btn, wnd_close )
end
end
addEventHandler( "window_text", getRootElement(), wnd_create )
I'd like the window appear after a client logged in to my server. After the login nothing happens with this script. Can someone help me please?