[HL2:DM] Eventscripts Kill Text to Source Python

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

[HL2:DM] Eventscripts Kill Text to Source Python

Postby Painkiller » Mon Dec 05, 2016 8:57 am

Could someone please insert me there with

It shows a game_text at the top left of the screen
Every time a kill ,Death, Multikill,Overkill, grenate kill,slam kill,slamwhore with 5 kills,crossbow bonus with 3 kills,postal with 12 kills,Postal fail in suizide,Postal dead,sensei kill with 16 kills,Sensei fail in suizide,Sensei Dead,Nomercy,Humiliation,Bonus distance Kill ,Firstblood,Suizide,Headshot and the frag kills from 3 to 11 , 12 , 16 Lay down on two lines.

Thanks in Advance


Example Video:
https://www.youtube.com/watch?v=KBGHbmKiR6k

Syntax: Select all

def showMessage2(message):
userid = es.getuserid()
if not userid:
return
index = es.createentity('game_text', 'MyMsgEntity')
es.entitysetvalue(index, 'origin', '0 0 0')
es.entitysetvalue(index, 'spawnflags', 1)
es.entitysetvalue(index, 'channel', 2)
es.entitysetvalue(index, 'fxtime', 1.0)
es.entitysetvalue(index, 'holdtime', 8)
es.entitysetvalue(index, 'fadeout', 1.5)
es.entitysetvalue(index, 'fadein', 0.01)
es.entitysetvalue(index, 'color2', '255 255 0')
es.entitysetvalue(index, 'color', '205 0 0')
es.entitysetvalue(index, 'effect', 2)
es.entitysetvalue(index, 'y', -0.88)
es.entitysetvalue(index, 'x', 0.01)
es.entitysetvalue(index, 'message', message)
es.server.insertcmd(
'es_xspawnentity %i;'% index + \
'es_xfire %i MyMsgEntity Display;'% userid + \
'es_xfire %i MyMsgEntity Kill'% userid
)

def player_death(ev):
userid = int(ev['userid'])
attacker = int(ev['attacker'])
xx,yy,zz = es.getplayerlocation(userid)
x,y,z = es.getplayerlocation(attacker)
distance = (((xx - x) * 2 + (yy - y) * 2 + (zz - z) * 2) * 0.5) / 40.0
if distance < 0:
distance = distance * -1
atk = playerlib.getPlayer(ev['attacker'])
namex = es.getplayername(ev['attacker'])
health = atk.health
armor = atk.armor
kills = float(playerlib.getPlayer(attacker).kills)
deaths = float(playerlib.getPlayer(attacker).deaths)
kdr = kills / deaths
kdr = "%.3f" % kdr
showMessage1('Attacker info:\n Name: %s \n Health: %s \n Armor: %s \n Distance: %s m \n KDR: %s' % (namex, health, armor, round(distance, 2), kdr), userid)



killdict[userid]['slamkills'] = 0
killdict[userid]['killstreak'] = 0
weapon = ev['weapon']
if weapon == "rpg_missile": name = "RPG"
elif weapon == "combine_ball": name = "Combine Ball"
elif weapon == "smg1_grenade": name = "Smg Grenade"
elif weapon == "ar2": name = "AR2"
elif weapon == "crossbow_bolt": name = "Crossbow"
elif weapon == "physcannon": name = "Physcannon"
elif weapon == "pistol": name = "Pistol"
elif weapon == "shotgun": name = "Shotgun"
elif weapon == "smg1": name = "SMG"
elif weapon == "357": name = "357"
elif weapon == "crowbar": name = "a Crowbar"
elif weapon == "stunstick": name = "a Stunstick"
elif weapon == "slam": name = "a Slam"
elif weapon == "grenade_frag": name = "a Grenade"
elif weapon == "physics":
if ev['es_attackerweapon'] == "weapon_physcannon":
name = "Physcannon"
if not ev['es_attackerweapon'] == "weapon_physcannon":
name = "a Barrel"
gamethread.delayed(1, resetkills, (attacker))
now = time.time()
killer, then_time = players.get(attacker, (None, 0))
killdict[attacker]['killstreak'] += 1
if userid != attacker:
killdict[attacker]['kills'] += 1
if userid != attacker:
message = ('%s killed %s with %s'% (ev['es_attackername'], ev['es_username'], name))
if userid == attacker:
message = ('%s commited suicide' % (ev['es_attackername']))
if killdict[attacker]['kills'] >= 2:
message = ('%s killed %s with %s \n%s Multikill!!!' % (ev['es_attackername'], ev['es_username'], name, ev['es_attackername']))
if killer == userid and now - then_time <= SAME_TIME_LIMIT:
message = ('%s and %s killed eachother at the same time!' % (ev['es_attackername'], ev['es_username']))
if weapon == 'slam':
killdict[attacker]['slamkills'] += 1
if killdict[attacker]['slamkills'] >= 3:
killdict[userid]['slamkills'] = 0
message = ('%s killed %s with %s \n%s is a Slamwhore and will be frozen for 10 seconds!'% (ev['es_attackername'], ev['es_username'], name, ev['es_attackername']))
if killdict[attacker]['killstreak'] == 12:
message = ('%s killed %s with %s \n%s is Postal!' % (ev['es_attackername'], ev['es_username'], name, ev['es_attackername']))
if killdict[attacker]['killstreak'] == 24:
message = ('%s killed %s with %s \n%s is Sensei!' % (ev['es_attackername'], ev['es_username'], name, ev['es_attackername']))
showMessage2(message)
players[userid] = (attacker, now)

def resetkills(attacker):
killdict[attacker]['kills'] = 0

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 18 guests