Jump to content

HOW TO MAKE WELCOME SCREEN PLZ HELP


MahaZ

Recommended Posts

serverside

root = getRootElement () 
function PlayerJoin () 
    triggerClientEvent ( source, "displayLogo", source, true ) 
    setTimer ( triggerClientEvent, 2000, 1, source, "displayLogo", source, false ) 
end 
addEventHandler ( "onPlayerJoin", root, PlayerJoin ) 

clientside

addEvent("displayLogo", true) 
function displayLogo(toggle) 
    if (toggle == true) then 
        local screenWidth, screenHeight = guiGetScreenSize() 
        Logo = guiCreateStaticImage(0, 0, screenWidth, screenHeight, 'serverlogo.bmp', false, nil) 
    else 
        destroyElement(Logo) 
        Logo = nil 
    end 
end 
addEventHandler("displayLogo", getRootElement(), displayLogo) 

in xml add your picture directory

then (clientside.lua,serverside.lua,yourepicture.format,xml) put in zip

Link to comment
serverside
local screenWidth, screenHeight = guiGetScreenSize() 
        Logo = guiCreateStaticImage(0, 0, screenWidth, screenHeight, 'serverlogo.bmp', false, nil) 

You can replace those 2 lines with 1

        Logo = guiCreateStaticImage(0, 0, 1, 1, 'serverlogo.bmp', true ) 

BTW, I wouldn't recommend using BMP since they are quite heavy and is really old. I'd recommend using PNG or JPG.

Link to comment
serverside

....

You can replace those 2 lines with 1

        Logo = guiCreateStaticImage(0, 0, 1, 1, 'serverlogo.bmp', true ) 

BTW, I wouldn't recommend using BMP since they are quite heavy and is really old. I'd recommend using PNG or JPG.

huh, since when is jpg also suported. i though that you can use only png.

Link to comment
serverside

....

You can replace those 2 lines with 1

        Logo = guiCreateStaticImage(0, 0, 1, 1, 'serverlogo.bmp', true ) 

BTW, I wouldn't recommend using BMP since they are quite heavy and is really old. I'd recommend using PNG or JPG.

huh, since when is jpg also suported. i though that you can use only png.

You can use jpg,png,bmp and other common image formats. Its just that all the default resources use PNG (and imo its better than jpeg)

Link to comment
Oww, so you can also use a gif image. I should test that one out. But look png are bigger files then, jpeg/jpg. That is better for the client, less download.

Yes GIF works too but if it's an animated GIF then it will stop on the first frame. JPGs are lighter but worse quality. I always used PNG for everything, they also support alpha channel so you don't have solid color background but instead it's transparent.

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