


Syntax: Select all
from events import Event
from players.entity import Player
from stringtables.downloads import Downloadables
def load():
dl = Downloadables()
dl.add("materials/x/killstreaks_v2/overkill-1.vmt")
dl.add("materials/x/killstreaks_v2/overkill-1.vtf")
@Event('player_death')
def player_death(args):
attacker = args['attacker']
if attacker > 0:
player = Player.from_userid(attacker)
player.client_command('r_screenoverlay x/killstreaks_v2/overkill-1.vmt')
player.delay(5, reset_overlay, (attacker,))
def reset_overlay(attacker):
Player.from_userid(attacker).client_command('r_screenoverlay 0')
daren adler wrote:if you do more damage than nessisary to kill someone thats overkill, you have it right tho,,thank you,,could you make it so if i kill more then 2 or more at a time it shows the overkill.
Syntax: Select all
from events import Event
from players.entity import Player
from stringtables.downloads import Downloadables
class OverkillPlayer(Player):
caching = True
def __init__(self, index):
super().__init__(index)
self.is_overkill = 0
def load():
dl = Downloadables()
dl.add("materials/x/killstreaks_v2/overkill-1.vmt")
dl.add("materials/x/killstreaks_v2/overkill-1.vtf")
@Event('player_death')
def player_death(args):
attacker = args['attacker']
if attacker > 0:
player = OverkillPlayer.from_userid(attacker)
if player.is_overkill:
player.is_overkill += 1
else:
player.is_overkill = 1
if player.is_overkill > 1:
player.client_command('r_screenoverlay x/killstreaks_v2/overkill-1.vmt')
player.delay(5, reset_overlay, (attacker,))
player.delay(1, reset_overkill, (attacker,))
def reset_overlay(attacker):
player = OverkillPlayer.from_userid(attacker)
player.client_command('r_screenoverlay 0')
def reset_overkill(attacker):
player = OverkillPlayer.from_userid(attacker)
player.is_overkill = 0
daren adler wrote:Could you add overkill sound when it happens ?, Heres the sound, it would go sound/79/overkill.mp3 https://www.dropbox.com/s/h91ybe1u9df9q ... s.zip?dl=0 . Thank you.
Syntax: Select all
from events import Event
from players.entity import Player
from stringtables.downloads import Downloadables
from engines.sound import Sound
overkill = Sound('79/overkill.mp3')
class OverkillPlayer(Player):
caching = True
def __init__(self, index):
super().__init__(index)
self.is_overkill = 0
def load():
dl = Downloadables()
dl.add("materials/x/killstreaks_v2/overkill-1.vmt")
dl.add("materials/x/killstreaks_v2/overkill-1.vtf")
dl.add("sound/79/overkill.mp3")
@Event('player_death')
def player_death(args):
attacker = args['attacker']
if attacker > 0:
player = OverkillPlayer.from_userid(attacker)
if player.is_overkill:
player.is_overkill += 1
else:
player.is_overkill = 1
if player.is_overkill > 1:
overkill.play(player.index)
player.client_command('r_screenoverlay x/killstreaks_v2/overkill-1.vmt')
player.delay(5, reset_overlay, (attacker,))
player.delay(1, reset_overkill, (attacker,))
def reset_overlay(attacker):
player = OverkillPlayer.from_userid(attacker)
player.client_command('r_screenoverlay 0')
def reset_overkill(attacker):
player = OverkillPlayer.from_userid(attacker)
player.is_overkill = 0
daren adler wrote:Very good job my friend![]()
Works great
![]()
Users browsing this forum: No registered users and 57 guests