Jump to content

Text while downloading server files


Sande

Recommended Posts

Hello, i would like to know how to make a text "Resources Loading, Please wait.". I have been trying to do it with onClientPreRender & dxDraw but some reason it didn´t work. So the idea is when you join to server there are coming text "Resources Loading, Please wait" and when these is loaded the text comes off.

Link to comment

addEvent( "onClientSend",true ) 
  
local serverDisplay,serverText 
  
addEventHandler( "onClientSend",root, 
    function( ) 
        textDisplayRemoveObserver( serverDisplay, source ) 
    end 
) 
  
addEventHandler( "onPlayerJoin",root, 
    function( ) 
        serverDisplay = textCreateDisplay( ) 
        textDisplayAddObserver ( serverDisplay, source ) 
        serverText = textCreateTextItem ( "Downloading.Please wait!", 0.5, 0.5,1,255,0,0,255,2,"center","center",200 )   
        textDisplayAddText ( serverDisplay, serverText )         
    end 
) 

local timer = setTimer( 
    function( ) 
        if not isTransferBoxActive( ) then 
            triggerServerEvent( "onClientSend",localPlayer ) 
            killTimer( timer ) 
        end  
    end, 
1000, 
2 ) 
  • Thanks 1
Link to comment
Does this show immediately if i change "onPlayerJoin" event to "onPlayerConnect", like other servers have it immeaditely when you join to the server.

Just Keep it, onPlayerJoin it will work when player enter immeditely .

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