Jump to content

Downloading screen ~ Need Help (SLOVED)


PrivateKiller

Recommended Posts

Hello!

I need some help. I want to have download screen which one will dissapear when player will log in(through login panel after download finish). Currently, download screen is still showing after players log in... That's my problem. So its logical when players will connect to my server, he will download new stuff first, before login panel shows up, and that's why I want to make download screen dissapear after players will log in. So guys, can you please help me?

Server side script:

dawnlodetext1 = " Welcome to GRAGHAX Gaming Server" --- the text up 
dawnlodetext2 = " Please be patience until download finish" --- the text in medium 
dawnlodetext3 = "Enjoy and have fun" --- the text under 
  
dis = textCreateDisplay() 
screentext = textCreateTextItem(dawnlodetext1,0.2,0.2,"medium",255,0,0,255,3) 
textDisplayAddText(dis,screentext) 
  
dis1 = textCreateDisplay() 
screentext1 = textCreateTextItem(dawnlodetext2,0.3,0.4,"medium",0,255,0,255,3) 
textDisplayAddText(dis1,screentext1) 
  
dis2 = textCreateDisplay() 
screentext2 = textCreateTextItem(dawnlodetext3,0.4,0.6,"medium",255,255,0,255,3) 
textDisplayAddText(dis2,screentext2) 
  
addEventHandler("onResourceStart",resourceRoot, 
    function () 
        for i,p in ipairs(getElementsByType("player")) do 
            textDisplayAddObserver(dis,p) 
            textDisplayAddObserver(dis1,p) 
            textDisplayAddObserver(dis2,p) 
        end 
    end 
) 
  
addEventHandler("onPlayerJoin",root, 
    function () 
         
     fadeCamera(source, true, 5) 
    setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) 
        textDisplayAddObserver(dis,source) 
        textDisplayAddObserver(dis1,source) 
        textDisplayAddObserver(dis2,source) 
    end 
) 
  
addEvent("removeText",true) 
addEventHandler("removeText",root, 
    function () 
        textDisplayRemoveObserver(dis,source) 
        textDisplayRemoveObserver(dis1,source) 
        textDisplayRemoveObserver(dis2,source) 
    end 
) 
  
  
  
  
  

Client side script

  
addEventHandler("onClientResourceStart",resourceRoot, 
    function () 
        triggerServerEvent("removeText",localPlayer) 
    end 
) 
  

Edited by Guest
Link to comment

delet client-side script and try with this:

  
  
dawnlodetext1 = " Welcome to GRAGHAX Gaming Server" --- the text up 
dawnlodetext2 = " Please be patience until download finish" --- the text in medium 
dawnlodetext3 = "Enjoy and have fun" --- the text under 
  
dis = textCreateDisplay() 
screentext = textCreateTextItem(dawnlodetext1,0.2,0.2,"medium",255,0,0,255,3) 
textDisplayAddText(dis,screentext) 
  
dis1 = textCreateDisplay() 
screentext1 = textCreateTextItem(dawnlodetext2,0.3,0.4,"medium",0,255,0,255,3) 
textDisplayAddText(dis1,screentext1) 
  
dis2 = textCreateDisplay() 
screentext2 = textCreateTextItem(dawnlodetext3,0.4,0.6,"medium",255,255,0,255,3) 
textDisplayAddText(dis2,screentext2) 
  
addEventHandler("onResourceStart",resourceRoot, 
    function () 
        for i,p in ipairs(getElementsByType("player")) do 
            textDisplayAddObserver(dis,p) 
            textDisplayAddObserver(dis1,p) 
            textDisplayAddObserver(dis2,p) 
        end 
    end 
) 
  
addEventHandler("onPlayerJoin",root, 
    function () 
        
     fadeCamera(source, true, 5) 
    setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) 
        textDisplayAddObserver(dis,source) 
        textDisplayAddObserver(dis1,source) 
        textDisplayAddObserver(dis2,source) 
    end 
) 
  
addEventHandler("onPlayerLogin",root, 
    function () 
        textDisplayRemoveObserver(dis,source) 
        textDisplayRemoveObserver(dis1,source) 
        textDisplayRemoveObserver(dis2,source) 
    end 
) 

Link to comment

Thanks for your reply NearGreen.

I tested what you said... Text dissapear when player login, but camera still showing VINEWOOD after player logins. I also don't want player to spawn before download finished. Can you help me?

ˇ

fadeCamera(source, true, 5) 
    setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) 

Here is all code:

  
dawnlodetext1 = " Welcome to Slovenia Gaming Server" --- the text up 
dawnlodetext2 = " Please be patient until the download finis" --- the text in medium 
dawnlodetext3 = "Enjoy and have fun" --- the text under 
  
dis = textCreateDisplay() 
screentext = textCreateTextItem(dawnlodetext1,0.2,0.2,"medium",255,0,0,255,3) 
textDisplayAddText(dis,screentext) 
  
dis1 = textCreateDisplay() 
screentext1 = textCreateTextItem(dawnlodetext2,0.3,0.4,"medium",0,255,0,255,3) 
textDisplayAddText(dis1,screentext1) 
  
dis2 = textCreateDisplay() 
screentext2 = textCreateTextItem(dawnlodetext3,0.4,0.6,"medium",255,255,0,255,3) 
textDisplayAddText(dis2,screentext2) 
  
addEventHandler("onResourceStart",resourceRoot, 
    function () 
        for i,p in ipairs(getElementsByType("player")) do 
            textDisplayAddObserver(dis,p) 
            textDisplayAddObserver(dis1,p) 
            textDisplayAddObserver(dis2,p) 
        end 
    end 
) 
  
addEventHandler("onPlayerJoin",root, 
    function () 
        
     fadeCamera(source, true, 5) 
    setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) 
        textDisplayAddObserver(dis,source) 
        textDisplayAddObserver(dis1,source) 
        textDisplayAddObserver(dis2,source) 
    end 
) 
  
addEventHandler("onPlayerLogin",root, 
    function () 
        textDisplayRemoveObserver(dis,source) 
        textDisplayRemoveObserver(dis1,source) 
        textDisplayRemoveObserver(dis2,source) 
    end 
) 

Link to comment
addEventHandler("onPlayerLogin",root, 
    function () 
        textDisplayRemoveObserver(dis,source) 
        textDisplayRemoveObserver(dis1,source) 
        textDisplayRemoveObserver(dis2,source) 
        setCameraTarget ( source, source ) 
        spawnPlayer ( source, 0, 0, 3 ) 
    end 
) 

Link to comment
addEventHandler("onPlayerLogin",root, 
    function () 
        textDisplayRemoveObserver(dis,source) 
        textDisplayRemoveObserver(dis1,source) 
        textDisplayRemoveObserver(dis2,source) 
        setCameraTarget ( source, source ) 
        spawnPlayer ( source, 0, 0, 3 ) 
    end 
) 

It working fine! Thank you!

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