• Connect Sounds
    4 replies, posted
ok heres an example from cs:s [CODE]{ "STEAM_0:0:xxxxxxxx" { "connect_sound" "connect/Sexy Bitch.mp3" "connect_message" "#green[Admin] «TøÐ» The Grimm Has Connected" "disconnect_sound" "0" "disconnect_message" "0" }[/CODE] i was wondering if there was a way to emit a sound when sombody joined by their steam id. so it only plays the song when that certain steam id connects for everybody to hear. heres an example lua i helped make that emits a sound when sombody types somthing [CODE]local chatSounds = { {msg = "9000", sound = "9000.mp3"}, } for k ,v in pairs(file.Find("../sound/chat/*")) do resource.AddFile("sound/chat/"..v) end hook.Add("PlayerSay", "ChatSounds", function(ply, msg) for k, v in pairs(chatSounds) do local m_Msg = string.Explode(" ", string.lower(msg)) for x, y in pairs(m_Msg) do if (v.msg == y) then ply:EmitSound("chat/"..v.sound) break end end end end )[/CODE] thats an example so can anybody help me peace these together to make one compatable for gmod?
[QUOTE=Wobbier;16983516]ok heres an example from cs:s [CODE]{ "STEAM_0:0:xxxxxxxx" { "connect_sound" "connect/Sexy Bitch.mp3" "connect_message" "#green[Admin] «TøÐ» The Grimm Has Connected" "disconnect_sound" "0" "disconnect_message" "0" }[/CODE] i was wondering if there was a way to emit a sound when sombody joined by their steam id. so it only plays the song when that certain steam id connects for everybody to hear. heres an example lua i helped make that emits a sound when sombody types somthing [CODE]local chatSounds = { {msg = "9000", sound = "9000.mp3"}, } for k ,v in pairs(file.Find("../sound/chat/*")) do resource.AddFile("sound/chat/"..v) end hook.Add("PlayerSay", "ChatSounds", function(ply, msg) for k, v in pairs(chatSounds) do local m_Msg = string.Explode(" ", string.lower(msg)) for x, y in pairs(m_Msg) do if (v.msg == y) then ply:EmitSound("chat/"..v.sound) break end end end end )[/CODE] thats an example so can anybody help me peace these together to make one compatable for gmod?[/QUOTE] You can do it via GM:PlayerAuthed and the SteamID() (SteamID() == "" ) functions
[QUOTE=Horsey;16983617]You can do it via GM:PlayerAuthed and the SteamID() (SteamID() == "" ) functions[/QUOTE] and...
Aw, come on, he pretty much told you it all. You should be able to figure it out. Use [url=http://wiki.garrysmod.com/?title=Entity.EmitSound]this[/url] to emit the sound, and use [url=http://wiki.garrysmod.com/?title=Gamemode.PlayerAuthed]this[/url] to do it when ever the player is authenticated with Steam and receives their SteamID.
[QUOTE=Capsup;16985454]Aw, come on, he pretty much told you it all. You should be able to figure it out. Use [url=http://wiki.garrysmod.com/?title=Entity.EmitSound]this[/url] to emit the sound, and use [url=http://wiki.garrysmod.com/?title=Gamemode.PlayerAuthed]this[/url] to do it when ever the player is authenticated with Steam and receives their SteamID.[/QUOTE] oh thanks for clarifying :D
Sorry, you need to Log In to post a reply to this thread.