Join sound

Is it possible to have a sound played as soon someone enters my server?

(i saw this one but the uploader never released the LUA script
http://www.garrysmod.org/downloads/?a=view&id=71943)

(And does anyone got some mods to keep the fun in the server high?)

Thanks for reading!

EDIT
Instead of making a new thread i will post it here…

When you join the server you get a amount of money (100) the more you play the more cash you earn, from cash you can buy restrictions, tools and weapons!
Is this possible?

Something like this, based on the players steamid, or you could have it whenever anyone joins.
[lua]

AddCSLuaFile(“joinsong.lua”);

if ( SERVER) then
function userAuthed( ply, stid, unid )
if stid == “STEAM_000000” then umsg.Start(“playzesound”)
umsg.End()
end
end
hook.Add( “PlayerAuthed”, “playerauthed”, userAuthed )
end

if (CLIENT) then
function playmysong()
surface.PlaySound(“whateversongyouwant.mp3”)
end
end
usermessage.Hook(“playzesound”, playmysong)
[/lua]

Your example was almost right, but it wouldn’t work. Try this, it should go to lua/autorun with the name joinsong.lua.
[lua]
– This could be anything in your sounds-folder.
local song = “joinsounds/joinsound.mp3”;

if(SERVER) then
– Send this script to the players.
AddCSLuaFile(“joinsong.lua”);

-- Send the song to the players.
resource.AddFile("sounds/" .. song);

-- When a player spawns for the first time..
hook.Add("PlayerInitialSpawn", "Play some song", function(ply)
	-- Send them an usermessage telling to play the song.
	SendUserMessage("playjoinsong", ply);
end);

else
– When we recieve the usermessage to play the song…
usermessage.Hook(“playjoinsong”, function()
– Play it.
surface.PlaySound(song);
end
end
[/lua]

Shouldnt it be surface.PlaySound not surface.PlaySong?

No need to have it server-side.

[lua]
– Save as joinsound.lua

local sound = “joinsounds/joinsound.mp3”

if SERVER then
AddCSLuaFile “joinsound.lua”
resource.AddFile( “sounds/” … sound )

return

end

local steamID = {
[“STEAM_0:1:23456789”] = true,
[“STEAM_0:1:98765432”] = true
}

hook.Add( “OnEntityCreated”, function( ent )
if ValidEntity( ent ) and ent:IsPlayer() and steamID[ent:SteamID()] then
surface.PlaySound( sound )
end
end )[/lua]

You should avoid useless networking.

Oke i will test this out, thanks guys