public override void OnKill(MissionLogEventKill data) { var attacker = data.Server.Players[data.AttackerId]; var target = data.Server.Players[data.TargetId]; var mysqlVars = "SET " + "Kill.EventId ='{0}', " + "Kill.Attacker.Name='{1}', " + "Kill.Target.Name='{2}', " + "Kill.Attacker.Country.Id='{3}', " + "Kill.Target.Country.Id='{4}'"; //Attacker is player if (attacker != null) { //Target is player either ? if (target != null) { this.mysql.ExecSql(mysqlVars, data.EventID, attacker.NickName, target.NickName, attacker.Country.Id, target.Country.Id); this.mysql.ExecSql("CALL RecordPlayerKill()"); Log.WriteInfo("Kill event: {0} by {1}", target.NickName, attacker.NickName); } } }
public override void OnKill(MissionLogEventKill data) { //Don't run script on this server if (!this.IsMyServer(data)) { return; } //If server is known - run some actions here }
public override void OnKill(MissionLogEventKill data) { Log.WriteInfo("New Event: {0}", "OnKill"); }