There was a job on Coderhire for someone to make them an animated welcome message appear on the screen when a player logs in. Not something that really needs paying for so I gave them this and thought I'd put it here as well in-case anyone else wants it.
I'm still new to Lua, so feel free to complain about my coding and hopefully I'll learn from my mistakes ;)
[url]https://github.com/Semajnad/sgn_welcomemessage[/url]
[B]Please ignore the talking, I was watching Talking Bad ;)[/B]
[video=youtube;1xJIFb102tc]http://www.youtube.com/watch?v=1xJIFb102tc[/video]
You could try and do it when the player first moves?
I did consider that. Either first move, or look for movements? But would that not require a check every few seconds to see if the player has moved and if they have check if the message has already been displayed?
[QUOTE=Ejbaker;44895661]You could try and do it when the player first moves?[/QUOTE]
Looks great. Thanks for this. Also, what Ejbaker said.
[QUOTE=Semajnad;44895717]I did consider that. Either first move, or look for movements? But would that not require a check every few seconds to see if the player has moved and if they have check if the message has already been displayed?[/QUOTE]
hook.Add it in initial spawn, hook.Remove it when it happens.
[lua]
if SERVER then
util.AddNetworkString( "welcomemessage" )
hook.Add( "PlayerInitialSpawn", "WelcomeMessage", function( ply )
net.Start( "welcomemessage" )
net.Send( ply )
end )
else
net.Receive( "welcomemessage", function()
hook.Add( "PlayerBindPress", "WelcomeMessageCLIENT", function()
// display welcome message
hook.Remove( "PlayerBindPress", "WelcomeMessageCLIENT" )
end )
end )
end
[/lua]
Thanks Humble, but I went with another option instead :)
[B]
To anyone interested, this, as far as I know, is now a fully working script. I've just added better checking for when the player is in, so it now will happen 5 seconds after the players entity has been created, instead of just when they have connected.
Also added removing the VGUI elements which I forgot, so they were always there but just invisible. That's been fixed.
Enjoy!
[/B]
That really can add some style to a server
Thanks for sharing!
Thanks, I'm gunna make up some more quick ones for things like admin announcements, and also add a similar message that will appear on the side of peoples screens to show players when they log in.
[QUOTE=RaptorJGW;44897729]That really can add some style to a server
Thanks for sharing![/QUOTE]
Aw, that's pretty neat! It's always nice to see small additions being released here.
I love small, simplistic scripts. Just small things that add to the server.
[QUOTE=NiandraLades;44897851]Aw, that's pretty neat! It's always nice to see small additions being released here.[/QUOTE]
Sorry, you need to Log In to post a reply to this thread.