How to track the player killed player? And get the name of the players
[DOUBLEPOST=1432244311][/DOUBLEPOST]In C#
Solved Getting player who killed player?
Discussion in 'Rust Development' started by mira-krasavchik, May 21, 2015.
-
Code:
void OnEntityDeath(BaseEntity entity, HitInfo hitinfo) { if (entity is BasePlayer) { BasePlayer victim = (BasePlayer)entity; if(hitinfo.Initiator != null && (hitinfo.Initiator is BasePlayer)) { BasePlayer attacker = (BasePlayer)hitinfo.Initiator; PrintToChat( string.Format("{0} killed {1}",attacker.displayName,victim.displayName) ); } } }
-
Reneb ,you're a real gangster! I like your plug-ins and use them! Thank you for your work and for your reply!
Why do not you make a plugin that stores in a database of players online, the number of murders and the other for display on the web site? -
Thanx! how to add a condition if the player asleep?