示例#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)
            {
                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);
            }
        }
    }
示例#2
0
文件: Example.cs 项目: rstoki/IL2CDR
    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
    }
示例#3
0
 public override void OnKill(MissionLogEventKill data)
 {
     Log.WriteInfo("New Event: {0}", "OnKill");
 }