Esempio n. 1
0
        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)
                {
                    mysql.ExecSql(mysqlVars, data.EventID, attacker.NickName, target.NickName, attacker.Country.Id, target.Country.Id);
                    mysql.ExecSql("CALL RecordPlayerKill()");
                    Log.WriteInfo("Kill event: {0} by {1}", target.NickName, attacker.NickName);
                }
            }
        }