

Syntax: Select all
2019-05-29 09:59:25 - sp - MESSAGE [SP] Loading plugin 'country_tag'...
2019-05-29 09:59:25 - sp - MESSAGE [SP] Successfully loaded plugin 'country_tag'.
2019-05-29 09:59:25 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-29 09:59:25 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-29 09:59:25 - sp - MESSAGE [SP] Loading plugin 'gamemode'...
2019-05-29 09:59:25 - sp - MESSAGE [SP] Successfully loaded plugin 'gamemode'.
2019-05-29 09:59:25 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-29 09:59:25 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-29 09:59:26 - sp - MESSAGE [SP] Unloading plugin 'killmessage'...
2019-05-29 09:59:26 - sp - MESSAGE [SP] Successfully unloaded plugin 'killmessage'.
2019-05-29 09:59:26 - sp - MESSAGE [SP] Unloading plugin 'headshot'...
2019-05-29 09:59:26 - sp - MESSAGE [SP] Successfully unloaded plugin 'headshot'.
2019-05-29 09:59:26 - sp - MESSAGE [SP] Unloading plugin 'gamemode'...
2019-05-29 09:59:26 - sp - MESSAGE [SP] Successfully unloaded plugin 'gamemode'.
2019-05-29 09:59:27 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-29 09:59:27 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-29 09:59:27 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-29 09:59:27 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-29 09:59:27 - sp - MESSAGE [SP] Loading plugin 'gamemode'...
2019-05-29 09:59:27 - sp - MESSAGE [SP] Successfully loaded plugin 'gamemode'.
2019-05-29 09:59:41 - sp - MESSAGE [SP] Unloading plugin 'killmessage'...
2019-05-29 09:59:41 - sp - MESSAGE [SP] Successfully unloaded plugin 'killmessage'.
2019-05-29 09:59:41 - sp - MESSAGE [SP] Unloading plugin 'headshot'...
2019-05-29 09:59:41 - sp - MESSAGE [SP] Successfully unloaded plugin 'headshot'.
2019-05-29 09:59:41 - sp - MESSAGE [SP] Unloading plugin 'gamemode'...
2019-05-29 09:59:41 - sp - MESSAGE [SP] Successfully unloaded plugin 'gamemode'.
2019-05-29 09:59:42 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-29 09:59:42 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-29 09:59:42 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-29 09:59:42 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-29 09:59:42 - sp - MESSAGE [SP] Loading plugin 'gamemode'...
2019-05-29 09:59:42 - sp - MESSAGE [SP] Successfully loaded plugin 'gamemode'.
2019-05-29 09:59:56 - sp - MESSAGE [SP] Unloading plugin 'killmessage'...
2019-05-29 09:59:56 - sp - MESSAGE [SP] Successfully unloaded plugin 'killmessage'.
2019-05-29 09:59:56 - sp - MESSAGE [SP] Unloading plugin 'headshot'...
2019-05-29 09:59:56 - sp - MESSAGE [SP] Successfully unloaded plugin 'headshot'.
2019-05-29 09:59:56 - sp - MESSAGE [SP] Unloading plugin 'gamemode'...
2019-05-29 09:59:56 - sp - MESSAGE [SP] Successfully unloaded plugin 'gamemode'.
2019-05-29 09:59:57 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-29 09:59:57 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-29 09:59:57 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-29 09:59:57 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-29 09:59:57 - sp - MESSAGE [SP] Loading plugin 'gamemode'...
2019-05-29 09:59:57 - sp - MESSAGE [SP] Successfully loaded plugin 'gamemode'.
2019-05-29 10:21:12 - sp - MESSAGE [SP] Loading plugin 'country_tag'...
2019-05-29 10:21:12 - sp - MESSAGE [SP] Successfully loaded plugin 'country_tag'.
2019-05-29 10:21:12 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-29 10:21:12 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-29 10:21:12 - sp - MESSAGE [SP] Loading plugin 'gamemode'...
2019-05-29 10:21:12 - sp - MESSAGE [SP] Successfully loaded plugin 'gamemode'.
2019-05-29 10:21:12 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-29 10:21:12 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-29 10:21:13 - sp - MESSAGE [SP] Unloading plugin 'killmessage'...
2019-05-29 10:21:13 - sp - MESSAGE [SP] Successfully unloaded plugin 'killmessage'.
2019-05-29 10:21:13 - sp - MESSAGE [SP] Unloading plugin 'headshot'...
2019-05-29 10:21:13 - sp - MESSAGE [SP] Successfully unloaded plugin 'headshot'.
2019-05-29 10:21:13 - sp - MESSAGE [SP] Unloading plugin 'gamemode'...
2019-05-29 10:21:13 - sp - MESSAGE [SP] Successfully unloaded plugin 'gamemode'.
2019-05-29 10:21:13 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-29 10:21:13 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-29 10:21:13 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-29 10:21:13 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-29 10:21:13 - sp - MESSAGE [SP] Loading plugin 'gamemode'...
2019-05-29 10:21:13 - sp - MESSAGE [SP] Successfully loaded plugin 'gamemode'.
2019-05-29 10:21:26 - sp - MESSAGE [SP] Unloading plugin 'killmessage'...
2019-05-29 10:21:26 - sp - MESSAGE [SP] Successfully unloaded plugin 'killmessage'.
2019-05-29 10:21:26 - sp - MESSAGE [SP] Unloading plugin 'headshot'...
2019-05-29 10:21:26 - sp - MESSAGE [SP] Successfully unloaded plugin 'headshot'.
2019-05-29 10:21:26 - sp - MESSAGE [SP] Unloading plugin 'gamemode'...
2019-05-29 10:21:26 - sp - MESSAGE [SP] Successfully unloaded plugin 'gamemode'.
2019-05-29 10:21:26 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-29 10:21:26 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-29 10:21:26 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-29 10:21:26 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-29 10:21:26 - sp - MESSAGE [SP] Loading plugin 'gamemode'...
2019-05-29 10:21:26 - sp - MESSAGE [SP] Successfully loaded plugin 'gamemode'.
2019-05-29 10:21:34 - sp - MESSAGE [SP] Unloading plugin 'killmessage'...
2019-05-29 10:21:34 - sp - MESSAGE [SP] Successfully unloaded plugin 'killmessage'.
2019-05-29 10:21:34 - sp - MESSAGE [SP] Unloading plugin 'headshot'...
2019-05-29 10:21:34 - sp - MESSAGE [SP] Successfully unloaded plugin 'headshot'.
2019-05-29 10:21:34 - sp - MESSAGE [SP] Unloading plugin 'gamemode'...
2019-05-29 10:21:34 - sp - MESSAGE [SP] Successfully unloaded plugin 'gamemode'.
2019-05-29 10:21:34 - sp - MESSAGE [SP] Loading plugin 'killmessage'...
2019-05-29 10:21:34 - sp - MESSAGE [SP] Successfully loaded plugin 'killmessage'.
2019-05-29 10:21:34 - sp - MESSAGE [SP] Loading plugin 'headshot'...
2019-05-29 10:21:34 - sp - MESSAGE [SP] Successfully loaded plugin 'headshot'.
2019-05-29 10:21:34 - sp - MESSAGE [SP] Loading plugin 'gamemode'...
2019-05-29 10:21:34 - sp - MESSAGE [SP] Successfully loaded plugin 'gamemode'.
2019-05-29 10:28:27 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\packages\source-python\events\listener.py", line 92, in fire_game_event
callback(game_event)
File "..\addons\source-python\plugins\killmessage\killmessage.py", line 114, in player_death
attplayer = Player.from_userid(attacker)
File "..\addons\source-python\packages\source-python\players\_base.py", line 99, in from_userid
return cls(index_from_userid(userid))
ValueError: Conversion from "Userid" (0) to "Index" failed.
2019-05-29 10:28:51 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\packages\source-python\events\listener.py", line 92, in fire_game_event
callback(game_event)
File "..\addons\source-python\plugins\killmessage\killmessage.py", line 114, in player_death
attplayer = Player.from_userid(attacker)
File "..\addons\source-python\packages\source-python\players\_base.py", line 99, in from_userid
return cls(index_from_userid(userid))
ValueError: Conversion from "Userid" (0) to "Index" failed.
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']
if attacker:
attplayer = Player.from_userid(attacker)
else:
return
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)
Syntax: Select all
@Event('player_death')
def player_death(ev):
victim = ev['userid']
attacker = ev['attacker']
if attacker in (0, victim):
return
attplayer = Player.from_userid(attacker)
Users browsing this forum: Bing [Bot] and 77 guests