Ulysses Stuff > Ulysses Release Archives
UJoin Sounder
JamminR:
Description:
Plays a sound to people who join your server
Current Version: v1
Features:
* Doesn't require ULib or ULX
* If more than one sound is in the table, picks a random one to play.
* Only plays the sound once they've obtained Steam authorization
* Won't follow them to every server, only servers that have this installed will play
Installation:
* Create file/Copy the following code into <your_server_path>gmod/lua/autorun/Ujoin_sounder.lua
--- Code: -----Quick dirty script for playing sounds to players who join your server.
--Edit to your hearts content. Rewrite it better. I'm not going major release with it.
--See below where to edit/add sounds. If you use CUSTOM ones, make sure your player has them (Forcedownload, etc)
--I used GCFScape for looking at what sounds are available. You may use Google.
local UJoin_Sound_Ver = "[UJoin Sound] - v1 loaded"
if SERVER then
local UJoin_sounds = { }
--=========EDIT HERE===========================================================
-- *Note* There is a ~255 character limit to one full sound path. Place trailing comma.
UJoin_sounds = {
"/vo/canals/shanty_gotword.wav",
"/vo/canals/boxcar_becareful_c.wav",
"/vo/canals/gunboat_getin.wav",
"/vo/canals/matt_goodluck.wav",
"/vo/canals/matt_tearringuprr_b.wav",
"/vo/coast/male01/youmadeit.wav",
}
--==========Don't edit below here (unless you know how) ========================
MsgN( UJoin_Sound_Ver )
AddCSLuaFile( "autorun/UJoin_Sounder.lua" )
function Send_Some_Sound( ply, steamid )
umsg.Start( "UJoin_sound", ply )
umsg.String( UJoin_sounds[ math.random( 1, table.getn( UJoin_sounds ) ) ] )
umsg.End()
end
hook.Add("PlayerAuthed", "SendASound", Send_Some_Sound)
else
MsgN( UJoin_Sound_Ver )
function UJoin_Play_sound( um )
UJoin_snd = um:ReadString()
util.PrecacheSound( UJoin_snd )
surface.PlaySound( UJoin_snd )
end
usermessage.Hook("UJoin_sound", UJoin_Play_sound )
end
--- End code ---
Very simple script at the request of a few I've seen in the threads here at Ulyssesmod.net
I've included a few fun sample sounds that I thought would work as greetings.
Other than GCFScape, I've found no comprehensive list of sound paths on the web. If you know/find one, please post the LINK here.
*NOTE* - This will not work in singleplayer or offline servers.
Megiddo:
Sweet. Good work.
benbrooks:
Very nice :)
I use custom sound entrances for certain people in my server, I use a modified version of Gjoin
stockley5:
Wow! Thanks JamminR, going to try this out tonight, thanks again
Stockley5
tku92:
Do you know anyway to make this so it could possibly play the sound while the game is loading instead of after the player is in the server, i probably sound crazy but ive seen it before and i really wish i knew how to do it.
Navigation
[0] Message Index
[#] Next page
Go to full version