[HL2:DM] Welcome Sound

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

[HL2:DM] Welcome Sound

Postby Painkiller » Sun May 14, 2017 7:22 pm

Hello community,

Someone could make me a welcome sound plugin?

-Welcome sound (https://forums.alliedmods.net/showthread.php?t=63161)
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] Welcome Sound

Postby Painkiller » Fri May 19, 2017 10:57 am

No one idea please?
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] Welcome Sound

Postby Painkiller » Tue Oct 03, 2017 2:19 pm

I have find this.
Load ok but no work.

Can anybody help?



Syntax: Select all

from core import GAME_NAME
from engines.sound import Sound
from events import Event
from players.entity import Player
from stringtables import string_tables
from stringtables.downloads import Downloadables


SOUND_PATH = "exae/rocks3.mp3"


class GenericSound(Sound):
def precache(self):
"""Precache the sample."""
if GAME_NAME in ("csgo", ): # Probably more games: L4D2 etc
string_tables.soundprecache.add_string(self.sample, self.sample)
else:
engine_sound.precache_sound(self.sample)

@property
def sample(self):
"""Return the filename of the Sound instance."""
if GAME_NAME in ("csgo", ):
return "*/{}".format(self._sample)

return self._sample


my_sound = GenericSound(SOUND_PATH)
downloadables = Downloadables()
downloadables.add("sound/{}".format(SOUND_PATH))


@Event('player_spawn')
def on_player_spawn(game_event):
player = Player.from_userid(game_event['userid'])
my_sound.play(player.index)

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 4 guests