Jump to content

[HELP]Welcome Message GUI


Shazzimal

Recommended Posts

Posted

Hey,

I was just trying to make my first script. Wat I was making is: When someone joins my server, there will come up a GUI window, on that window are comming some rules commands etc. i maked this script and meta:

server.lua

addEventHandler("onPlayerJoin",getRootElement(), 
function createWelcomeMessage() 
    local X = 0.375 
    local Y = 0.375 
    local Width = 0.25 
    local Height = 0.25 
    wdwWelcome = guiCreateWindow(X, Y, Width, Height, "Welcome to my server.", true) 
     
    X = 0.0825 
    Y = 0.2 
     
    Width = 0.25 
    Height = 0.25 
     
    guiCreateLabel(X, Y, Width, Height, "Welcome to my server! etc...") 
     
    guiSetVisible(wdwWelcome, false) 
end 

meta.xml

<meta> 
    <info author="Shazzimal" name="welcomeMessage" version="1.0" disc="Will create a welcome message at join."/> 
    <script src="server.lua"/> 
</meta> 

I tried to run it on my server but my server, doesn't recognized it, why?

Thanks

My resources: Didn't make one yet.

n-560x95.png

Momently in build!

Posted
wdwWelcome = { 
} 
  
    local X = 0.375 
    local Y = 0.375 
    local Width = 0.25 
    local Height = 0.25 
    wdwWelcome = guiCreateWindow(X, Y, Width, Height, "Welcome to my server.", true) 
    X = 0.0825 
    Y = 0.2 
    Width = 0.25 
    Height = 0.25 
    guiCreateLabel(X, Y, Width, Height, "Welcome to my server! etc..." , true , wdwWelcome) 
  
  

  

Posted
wdwWelcome = { 
} 
  
    local X = 0.375 
    local Y = 0.375 
    local Width = 0.25 
    local Height = 0.25 
    wdwWelcome = guiCreateWindow(X, Y, Width, Height, "Welcome to my server.", true) 
    X = 0.0825 
    Y = 0.2 
    Width = 0.25 
    Height = 0.25 
    guiCreateLabel(X, Y, Width, Height, "Welcome to my server! etc..." , true , wdwWelcome) 
  
  

There is no need for declaring a table variable with the name 'wdwWelcome'.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted
wdwWelcome = { 
} 
  
    local X = 0.375 
    local Y = 0.375 
    local Width = 0.25 
    local Height = 0.25 
    wdwWelcome = guiCreateWindow(X, Y, Width, Height, "Welcome to my server.", true) 
    X = 0.0825 
    Y = 0.2 
    Width = 0.25 
    Height = 0.25 
    guiCreateLabel(X, Y, Width, Height, "Welcome to my server! etc..." , true , wdwWelcome) 
  
  

There is no need for declaring a table variable with the name 'wdwWelcome'.

Thanks .

  

Posted

Thanks for your help guys, but what is the different between server- en client side. And must i add the addEventHandler, or?

My resources: Didn't make one yet.

n-560x95.png

Momently in build!

Posted (edited)

To all players?

And what does client side?

Must i add the addEventHandler?

Edited by Guest

My resources: Didn't make one yet.

n-560x95.png

Momently in build!

Posted

Some functions/events are client or server side only, like all GUI/DX drawing functions are client side only, you can't use them server side.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Oke, i am always going to add a command to open it, just add this?

addCommandHandler(Welcome, function ... ) 

Wich function must i use?

My resources: Didn't make one yet.

n-560x95.png

Momently in build!

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