HL2DM-killstreaks,headshots, deaths, kills Score (frags)
- daren adler
- Senior Member
- Posts: 328
- Joined: Sat May 18, 2019 7:42 pm
HL2DM-killstreaks,headshots, deaths, kills Score (frags)
Hello source python script makers. I am wondering if someone could make me a scoreboard, by holding the Tab button it shows stuff like the one on the far left in green of this image https://steamuserimages-a.akamaihd.net/ ... 7F00E98CF/ .. and again THANK YOU
Last edited by daren adler on Mon Sep 28, 2020 8:19 pm, edited 1 time in total.
- Painkiller
- Senior Member
- Posts: 726
- Joined: Sun Mar 01, 2015 8:09 am
- Location: Germany
- Contact:
Re: HL2DM-killstreaks,headshots, deaths, kills Score (frags)
You can test it, it is old but should work.
You create a folder called "killmessage under plugins.
There you create a python file called killmessage.py.
And
A folder name config in this folder you carry a frag.txt.
frag.cfg
killmessage.py
Maybe there is someone else who can add the missing things to you.
Grenadekill,multikill,overkill, jihad, headshot, slam kill etc what you need.
You create a folder called "killmessage under plugins.
There you create a python file called killmessage.py.
And
A folder name config in this folder you carry a frag.txt.
frag.cfg
Syntax: Select all
[3]
msg = "%s has 3 kill in a row!"
msgto = "v"
snd = "exae/postal/x3.mp3"
attover = "exae/postal/9-togo-030510.vmt"
[4]
msg = "%s has 4 kill in a row!"
msgto = "v"
snd = "exae/postal/x4.mp3"
attover = "exae/postal/8-togo-030510.vmt"
[5]
msg = "%s has 5 kill in a row!"
msgto = "v"
snd = "exae/postal/5inarow.mp3"
attover = "exae/postal/7-togo-030510.vmt"
[6]
msg = "%s has 6 kill in a row!"
msgto = "v"
snd = "exae/postal/x6.mp3"
attover = "exae/postal/6-togo-030510.vmt"
[7]
msg = "%s has 7 kill in a row!"
msgto = "v"
snd = "exae/postal/x7.mp3"
attover = "exae/postal/5-togo-030510.vmt"
[8]
msg = "%s has 8 kill in a row!"
msgto = "v"
snd = "exae/postal/x8.mp3"
attover = "exae/postal/4-togo-030510.vmt"
[9]
msg = "%s has 9 kill in a row!"
msgto = "v"
snd = "exae/postal/x9.mp3"
attover = "exae/postal/3-togo-030510.vmt"
[10]
msg = "%s IS OUT OF CONTROL! WAKE UP BITCHES 2 KILLS IN A ROW!"
msgto = "v"
snd = "exae/postal/x10.mp3"
attover = "exae/postal/2-togo-030510.vmt"
[11]
msg = "HEY ! %s IS GOING PoSt@L! Bitchslap him and claim the bonus kill reward!!"
msgto = "v"
snd = "exae/postal/11inarow.mp3"
attover = "exae/postal/10-togo-1.vmt"
[12]
msg = "%s is the PoSt@L !!!"
msgto = "v"
snd = "exae/postal/postel12.mp3"
attover = "exae/rockskillstreak.vmt"
[16]
msg = "%s is the Sensei !"
msgto = "v"
snd = "exae/quake/rockspostalsensei1.mp3"
attover = "exae/zombie_vision.vmt"
killmessage.py
Syntax: Select all
from events import Event
from colors import Color
from players.entity import Player
from messages import HudMsg
import core
from listeners.tick import Delay
from filters.players import PlayerIter
from path import path as Path
import sys
import os
from configobj import ConfigObj
from stringtables.downloads import Downloadables
downloads = Downloadables()
kill_dict = {}
has_overlay = {}
cfg_list = []
#Helper Functions
def show_message(index, message):
HudMsg(
message=message,
x=0.01,
y=-0.88,
color1=Color(255,255,0),
color2=Color(255,0,0),
effect=2,
fade_in=0.01,
fade_out=1.5,
hold_time=8,
fx_time=1.0,
channel=2
).send(index)
def show_message_all(message):
HudMsg(
message=message,
x=0.01,
y=-0.88,
color1=Color(255,255,0),
color2=Color(205,0,0),
effect=2,
fade_in=0.01,
fade_out=1.5,
hold_time=8,
fx_time=1.0,
channel=2
).send()
def get_addon_path():
path = os.path.dirname(os.path.abspath(__file__))
return path
def test(index):
core.console_message(index)
def create_overlay(index, overlay):
player = Player(index)
player.client_command('r_screenoverlay %s' % overlay)
has_overlay[player.userid] = 1
def remove_overlay(index):
player = Player(index)
player.client_command('r_screenoverlay 0')
def play_sound(sound):
for player in PlayerIter("all"):
player.play_sound(sound,1.0,0.0, download=True)
#Ini Class
class InI(object):
def __init__(self):
self.path = get_addon_path()
self.config = os.path.join(self.path, 'config', 'frag.ini')
@property
def getConfigs(self):
return ConfigObj(self.config)
ini = InI()
for x in ini.getConfigs:
cfg_list.append(x)
file = ini.getConfigs[x]['attover']
file_vtf = file.replace('.vmt', '.vtf')
downloads.add('materials/' + file)
downloads.add('materials/' + file_vtf)
#Test Functions
def load():
for play in PlayerIter("all"):
kill_dict[play.userid] = 0
has_overlay[play.userid] = 0
@Event('player_connect')
def player_connect(ev):
userid = ev['userid']
kill_dict[userid] = 0
has_overlay[userid] = 0
@Event('player_death')
def player_death(ev):
victim = ev['userid']
attacker = ev['attacker']
attplayer = Player.from_userid(attacker)
vicplayer = Player.from_userid(victim)
kill_dict[victim] = 0
if has_overlay[victim] == 1:
remove_overlay(vicplayer.index)
has_overlay[victim] = 0
kill_dict[attacker] += 1
if str(kill_dict[attacker]) in cfg_list:
num = str(kill_dict[attacker])
cfg = ini.getConfigs
message = cfg[num]['msg']
if "%s" in message:
message = message.replace("%s", attplayer.name)
msgto = cfg[num]['msgto']
snd = cfg[num]['snd']
attover = cfg[num]['attover']
if msgto == 'v':
msgto = Player.from_userid(victim).index
if msgto == 'a':
msgto = Player.from_userid(attacker).index
show_message_all(message)
play_sound(snd)
create_overlay(Player.from_userid(attacker).index, attover)
Maybe there is someone else who can add the missing things to you.
Grenadekill,multikill,overkill, jihad, headshot, slam kill etc what you need.
Who is online
Users browsing this forum: No registered users and 40 guests