print player name function
Posted: Tue Apr 03, 2018 1:05 pm
this code run perfectly
('user ID "{}" was killed by attacker ID "{}" by weapon "{}")
print the user 156 was killed by attacker 157 by weapon ak47
But i need to print the user name instead of the userid !!
what can do ?To print name of the player and name of the attacker
('user ID "{}" was killed by attacker ID "{}" by weapon "{}")
print the user 156 was killed by attacker 157 by weapon ak47
But i need to print the user name instead of the userid !!
what can do ?To print name of the player and name of the attacker
Syntax: Select all
from events import Event
from messages import SayText2
@Event('player_death')
def on_player_death(game_event):
userid = game_event['userid']
attacker = game_event['attacker']
weapon = game_event['weapon']
SayText2('user ID "{}" was killed by attacker ID "{}" by weapon "{}"'.format(userid, attacker, weapon)).send()