Quakesounds

Release your plugins here!
User avatar
daren adler
Senior Member
Posts: 348
Joined: Sat May 18, 2019 7:42 pm

Re: Quakesounds

Postby daren adler » Wed Dec 23, 2020 2:21 am

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 :cool:
cssbestrpg
Senior Member
Posts: 310
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: Quakesounds

Postby cssbestrpg » Wed Dec 23, 2020 9:50 am

Updated plugin fix path warning
Fixed errors came in css at killer line
cssbestrpg
Senior Member
Posts: 310
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: Quakesounds

Postby cssbestrpg » Tue Apr 06, 2021 7:17 pm

Added teamkiller sound(Untested)
Fixed showing sometimes value errors
User avatar
daren adler
Senior Member
Posts: 348
Joined: Sat May 18, 2019 7:42 pm

Re: Quakesounds

Postby daren adler » Wed Apr 07, 2021 6:23 am

How can i turn off team killer sound? i am hl2dm, no teams and it keeps saying team killer.
cssbestrpg
Senior Member
Posts: 310
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: Quakesounds

Postby cssbestrpg » Wed Apr 07, 2021 6:28 am

I didn't make a config for it, but try newest version, i just made a possible fix for it(Untested)
User avatar
daren adler
Senior Member
Posts: 348
Joined: Sat May 18, 2019 7:42 pm

Re: Quakesounds

Postby daren adler » Wed Apr 07, 2021 6:33 am

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.
cssbestrpg
Senior Member
Posts: 310
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: Quakesounds

Postby cssbestrpg » Fri Apr 09, 2021 3:18 pm

Update:
- Fixed teamkiller sound playing when enemy kills your or you kill them
- Possible fix for teamkiller sound play to correctly(Untested)
User avatar
daren adler
Senior Member
Posts: 348
Joined: Sat May 18, 2019 7:42 pm

Re: Quakesounds

Postby daren adler » Sat Apr 10, 2021 3:42 am

ok, ill give it a try, ty :cool:
cssbestrpg
Senior Member
Posts: 310
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: Quakesounds

Postby cssbestrpg » Thu Apr 29, 2021 7:53 pm

Update:
- Changed soundlib use Sound class to play sound, instead using client command for sound play
- Removed no needed imports soundlib
User avatar
Loki
Junior Member
Posts: 3
Joined: Wed Nov 27, 2024 11:45 am
Location: Switzerland
Contact:

Re: Quakesounds

Postby Loki » Tue Dec 17, 2024 5:32 pm

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.
cssbestrpg
Senior Member
Posts: 310
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: Quakesounds

Postby cssbestrpg » Tue Dec 17, 2024 6:10 pm

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'}
User avatar
Loki
Junior Member
Posts: 3
Joined: Wed Nov 27, 2024 11:45 am
Location: Switzerland
Contact:

Re: Quakesounds

Postby Loki » Wed Dec 18, 2024 12:37 pm

No joy on that untested version.
User avatar
Loki
Junior Member
Posts: 3
Joined: Wed Nov 27, 2024 11:45 am
Location: Switzerland
Contact:

Re: Quakesounds

Postby Loki » Sun Dec 29, 2024 3:20 pm

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

Return to “Plugin Releases”

Who is online

Users browsing this forum: No registered users and 9 guests