FelipeMallmann Posted January 26, 2014 Share Posted January 26, 2014 I've this code, but when I type /vip, the image doesn't appear. In fact, it appears when players enter in the server. newFont = guiCreateFont ( "s3d.ttf", 15 ) localPlayer = getLocalPlayer() wnd_window = {} addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), function ( theResource ) --outputConsole( "wnd_showServerInfo called" ) --outputConsole( " Fonte: ".. 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("~~> The Real DAYZ <~~", "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, 2.40, 0.87, logo, true, wnd_window.wnd ) wnd_window.close_btn = guiCreateButton( 0.0, 0.91, 3.3, 0.1, "Fechar", true, wnd_window.wnd ) guiSetFont ( wnd_window.close_btn, newFont ) --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 ) addCommandHandler( "vip", getRootElement(), wnd_create ) What is wrong? Link to comment
Anubhav Posted January 26, 2014 Share Posted January 26, 2014 It won't create image. It will create window. Link to comment
Moderators IIYAMA Posted January 26, 2014 Moderators Share Posted January 26, 2014 Because only the server knows what the parameters are: title, logo,content. Btw did you asked the owner if you are allow to edit his script? @Anubhav First read the code careful and then your conclusion. > guiCreateStaticImage, this is a gui image. Link to comment
FelipeMallmann Posted January 26, 2014 Author Share Posted January 26, 2014 yes I'm allowed, it's not encrypted and is public realease.. but how to fix that? Link to comment
Moderators IIYAMA Posted January 26, 2014 Moderators Share Posted January 26, 2014 Well you need to know those arguments, before you can show anything. > title, logo, content That will be send from serverside. (this is clientside) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now