Hello community,
Someone could make me a welcome sound plugin?
-Welcome sound (https://forums.alliedmods.net/showthread.php?t=63161)
[HL2:DM] Welcome Sound
- Painkiller
- Senior Member
- Posts: 751
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
- Painkiller
- Senior Member
- Posts: 751
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
Re: [HL2:DM] Welcome Sound
No one idea please?
- Painkiller
- Senior Member
- Posts: 751
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
Re: [HL2:DM] Welcome Sound
I have find this.
Load ok but no work.
Can anybody help?
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)
Who is online
Users browsing this forum: No registered users and 76 guests