[HL2:DM] Deathmsg Help
Posted: Sat Oct 08, 2016 1:43 pm
Hello, this plugin does not work with the latest SP version.
Could someone help me to repair?
[code][/code]
Thanks in Advance
Could someone help me to repair?
Syntax: Select all
from colors import Color
from cvars.public import PublicConVar
from events import Event
from messages import HudMsg
from players.entity import Player
from players.helpers import index_from_userid
from plugins.info import PluginInfo
info = PluginInfo()
info.name = 'deathmsg'
info.author = 'RocKs'
info.version = 'version (Final)'
info.basename = 'deathmessage'
info.variable = info.basename + '_version'
info.url = 'http://www.rocks-clan.de'
info.convar = PublicConVar(info.variable, info.version, info.name + ' Version')
@Event('player_death')
def player_death(game_event):
victim_userid = game_event.get_int('userid')
victim = Player(index_from_userid(victim_userid))
attacker_userid = game_event.get_int('attacker')
if attacker_userid in (victim_userid, 0):
return
attacker = Player(index_from_userid(attacker_userid))
distance = attacker.origin.get_distance(victim.origin)
kdr = attacker.kills / attacker.deaths if attacker.deaths != 0 else 0
kdr = "%.3f" % kdr
HudMsg(
"Attacker info:\n "
"Name: %s\n"
"Health: %s\n"
"Armor: %s\n"
"Distance: %s units\n"
"KDR: %s" % (
attacker.name,
attacker.health,
attacker.armor,
round(distance, 2),
kdr
),
-1, 0.3,
Color(255, 0, 0),
Color(255, 255, 0),
0, 0.05, 1.5, 8, 1.0, 4
).send(victim.index)
[code][/code]
Thanks in Advance