Forum
![>](img/i_next.png)
![>](img/icons/cs2d.png)
![>](img/i_next.png)
![>](img/i_next.png)
Play sound when the player join the server
7 Antworten![Zum Anfang](img/i_first.png)
![Vorherige](img/i_prev.png)
![Nächste](img/i_next.png)
![Zum Anfang](img/i_last.png)
1
2
3
4
5
2
3
4
5
function SoundOnJoin(id) parse('sv_sound2 ' .. id .. ' pathsoundhere') end addhook('join', 'SoundOnJoin')
pathsoundhereinside the string quotes must be replaced with the path location of your specific sound.
![user](img/i_friend.png)
1
2
3
4
2
3
4
function SoundOnJoin(id) parse('sv_sound2 ' .. id .. ' C:\Users\PC\Documents\CS2D\sfx\music.ogg') end addhook('join', 'SoundOnJoin')
1
2
3
4
5
2
3
4
5
function SoundOnJoin(id) parse('sv_sound2 ' .. id .. ' \sfx\music.ogg') end addhook('join', 'SoundOnJoin')
![user](img/i_friend.png)
1
sfx/music.ogg
![user](img/i_friend.png)
music.ogg
![user](img/i_friend.png)
I believe that player won't hear a sound started during a join-hook function.
![](img/smiles/smile.gif)
![cs2d lua hook](img/i_codehelp.png)
![Zum Anfang](img/i_first.png)
![Vorherige](img/i_prev.png)
![Nächste](img/i_next.png)
![Zum Anfang](img/i_last.png)