Jump to content

creating image


Recommended Posts

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
  • Moderators

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

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