Page 2 of 2
Re: Quakesounds
Posted: Wed Dec 23, 2020 2:21 am
by daren adler
satoon101 wrote:That's just a warning, so nothing to be concerned about. The plugin can be updated to use path.Path instead of path.path to fix that warning. In future versions of the path package, they did remove path.path. I'm not sure if/when we'll update the SP version of that package, but if/when we do, it will break any plugins that use path.path.
ok ty for the info
Re: Quakesounds
Posted: Wed Dec 23, 2020 9:50 am
by cssbestrpg
Updated plugin fix path warning
Fixed errors came in css at killer line
Re: Quakesounds
Posted: Tue Apr 06, 2021 7:17 pm
by cssbestrpg
Added teamkiller sound(Untested)
Fixed showing sometimes value errors
Re: Quakesounds
Posted: Wed Apr 07, 2021 6:23 am
by daren adler
How can i turn off team killer sound? i am hl2dm, no teams and it keeps saying team killer.
Re: Quakesounds
Posted: Wed Apr 07, 2021 6:28 am
by cssbestrpg
I didn't make a config for it, but try newest version, i just made a possible fix for it(Untested)
Re: Quakesounds
Posted: Wed Apr 07, 2021 6:33 am
by daren adler
I got it,,all i did was remove the line. Im sorry i forgot to say,,i cleared the old one and added your new one already.
Re: Quakesounds
Posted: Fri Apr 09, 2021 3:18 pm
by cssbestrpg
Update:
- Fixed teamkiller sound playing when enemy kills your or you kill them
- Possible fix for teamkiller sound play to correctly(Untested)
Re: Quakesounds
Posted: Sat Apr 10, 2021 3:42 am
by daren adler
ok, ill give it a try, ty
Re: Quakesounds
Posted: Thu Apr 29, 2021 7:53 pm
by cssbestrpg
Update:
- Changed soundlib use Sound class to play sound, instead using client command for sound play
- Removed no needed imports soundlib
Re: Quakesounds
Posted: Tue Dec 17, 2024 5:32 pm
by Loki
I have tested this with HL2DM on a Windows based server. The SP plugin loads okay, the sounds download. But no sounds play in game, no messages in the console. SP recently updated for HL2DM, so using version 724.
Re: Quakesounds
Posted: Tue Dec 17, 2024 6:10 pm
by cssbestrpg
Try this one, it should fix the issue(Untested)
Syntax: Select all
import path
from core import GAME_NAME
from players.entity import Player
from engines.sound import Sound
from events import Event
from players.constants import HitGroup
from stringtables.downloads import Downloadables
from listeners import OnLevelInit
__FILEPATH__ = path.Path(__file__).dirname()
DOWNLOADLIST_PATH = __FILEPATH__ + '/download/download.txt'
players = {}
_firstblood = False
def load():
setDL()
def setDL():
downloadables = Downloadables()
with open(DOWNLOADLIST_PATH) as f:
for line in f:
line = line.strip()
if not line:
continue
downloadables.add(line)
@OnLevelInit
def map_start(map):
players.clear()
def _play(sound):
Sound(f'quake/{sound}').play()
@Event('round_start')
def round_start(args):
_play('prepare.mp3')
setFirstblood(True)
@Event('player_spawn')
def player_spawn(args):
userid = args.get_int('userid')
if not userid in players:
players[userid] = 0
@Event('player_death')
def player_death(args):
userid = args.get_int('userid')
attacker = args.get_int('attacker')
if attacker > 0:
if userid == attacker:
players[userid] = 0
_play('suicide.wav')
player = Player.from_userid(userid)
if not player.team == Player.from_userid(attacker).team:
players[userid] = 0
players[attacker] += 1
if _firstblood and GAME_NAME == 'cstrike':
_play('firstblood.wav')
setFirstblood(False)
else:
sound = getSound(players[attacker])
if sound is not None:
_play(sound)
if GAME_NAME == 'cstrike' and args.get_int('headshot'):
_play('headshot.mp3')
else:
if player.last_hitgroup == HitGroup.HEAD:
_play('headshot.mp3')
if args.get_string('weapon') == 'knife':
_play('humiliation.mp3')
def setFirstblood(a):
global _firstblood
_firstblood = a
def getSound(i):
if i in _sounds:
return _sounds[i]
return None
_sounds = {5: 'multikill.mp3', 6: 'rampage.mp3', 7: 'killingspree.mp3', 9: 'dominating.mp3', 15: 'ultrakill.mp3', 18: 'ludicrouskill.wav', 20: 'wickedsick.mp3', 21: 'monsterkill.mp3', 23: 'holyshit.mp3', 24: 'godlike.mp3', 32: 'bottomfeeder.mp3', 35: 'unstoppable.mp3'}
Re: Quakesounds
Posted: Wed Dec 18, 2024 12:37 pm
by Loki
No joy on that untested version.
Re: Quakesounds
Posted: Sun Dec 29, 2024 3:20 pm
by Loki
Updated version for HL2DM. Many thanks to cssbestrpg for his updated code, and for helping to test.
Code: Select all
from events import Event
from core import GAME_NAME
from filters.players import PlayerIter
from players.entity import Player
from players.constants import HitGroup
from stringtables.downloads import Downloadables
from listeners import OnLevelInit
players = {}
_firstblood = False
_sounds = {15: 'multikill.mp3', 5: 'rampage.mp3', 7: 'killingspree.mp3', 9: 'dominating.mp3', 15: 'ultrakill.mp3', 18: 'ludicrouskill.wav', 20: 'wickedsick.mp3', 21: 'monsterkill.mp3', 23: 'holyshit.mp3', 24: 'godlike.mp3', 32: 'bottomfeeder.mp3', 35: 'unstoppable.mp3'}
_others = {0: 'prepare.mp3', 1: 'firstblood.wav', 2: 'humiliation.mp3', 3: 'headshot.mp3'}
downloadables = Downloadables()
for i in _sounds:
downloadables.add(f'sound/quake/{_sounds[i]}')
for i in _others:
downloadables.add(f'sound/quake/{_others[i]}')
@OnLevelInit
@Event('round_start')
def map_start(current_map=None):
players.clear()
_play('prepare.mp3')
setFirstblood(True)
def _play(sound):
for player in PlayerIter('human'):
player.client_command(f'play quake/{sound}')
@Event('player_spawn')
def player_spawn(args):
userid = args.get_int('userid')
if not userid in players:
players[userid] = 0
@Event('player_death')
def player_death(args):
userid = args.get_int('userid')
attacker = args.get_int('attacker')
if userid == attacker:
players[userid] = 0
_play('suicide.wav')
player = Player.from_userid(userid)
players[userid] = 0
players[attacker] += 1
if _firstblood is True:
_play('firstblood.wav')
setFirstblood(False)
else:
sound = getSound(players[attacker])
if sound is not None:
_play(sound)
if GAME_NAME == 'cstrike' and args.get_int('headshot') or player.last_hitgroup == HitGroup.HEAD:
_play('headshot.mp3')
if args.get_string('weapon') == 'crowbar':
_play('humiliation.mp3')
def setFirstblood(a):
global _firstblood
_firstblood = a
def getSound(i):
if i in _sounds:
return _sounds[i]
return None