

Syntax: Select all
from events import Event
from engines.sound import Sound
from stringtables.downloads import Downloadables
WINNER_SOUND = Sound('x/chat/badboys/badboys_001.mp3')
def load():
dl = Downloadables()
dl.add('sound/x/chat/badboys/badboys_001.mp3')
@Event('game_end')
def game_end(args):
if args['winner'] > 1:
WINNER_SOUND.play()
Syntax: Select all
from events import Event
from players.helpers import edict_from_userid
from filters.players import PlayerIter
from engines.server import engine_server
from stringtables.downloads import Downloadables
def load():
dl = Downloadables()
dl.add('sound/x/chat/badboys/badboys_001.mp3')
@Event('game_end')
def game_end(args):
if args['winner']:
for i in getUseridList():
playgamesound(i, 'sound/x/chat/badboys/badboys_001.mp3')
def getUseridList():
for i in PlayerIter.iterator():
yield i.userid
def playgamesound(userid, _sound):
client_command(userid, 'play %s' % _sound)
def client_command(userid, __cmd__):
engine_server.client_command(edict_from_userid(userid), __cmd__)
Users browsing this forum: Bing [Bot] and 38 guests