コード例 #1
0
ファイル: Money.cs プロジェクト: m839336369/Rust_JianxianS
 private void Hooks_OnNPCKilled(Fougerite.Events.DeathEvent de)
 {
     if (de.Attacker != null && de.Victim != null && de.AttackerIsPlayer)
     {
         NPC npc = (NPC)de.Victim;
         if (npc.Name == "MutantBear" || npc.Name == "MutantWolf")
         {
             Fougerite.Player killer = (Fougerite.Player)de.Attacker;
             AddMoney(killer, 1);
             killer.Message("[color#99FF]成功击杀一个异兽,获得1斩仙币 /zxsc 查询斩仙商店");
         }
     }
 }
コード例 #2
0
ファイル: Money.cs プロジェクト: m839336369/Rust_JianxianS
 private void Hooks_OnPlayerKilled(Fougerite.Events.DeathEvent de)
 {
     if (de.Attacker != null && de.AttackerIsPlayer && de.VictimIsPlayer && de.Victim != null)
     {
         //Example to add 1 money to the killer
         Fougerite.Player killer = (Fougerite.Player)de.Attacker;
         if (killer.SteamID != "")
         {
             if (de.Attacker != de.Victim)
             {
                 AddMoney(killer, 1);
                 killer.Message("[color#99FF]成功击杀一个剑客,获得1斩仙币 /zxsc 查询斩仙商店");
             }
         }
     }
 }
コード例 #3
0
ファイル: AnticheatModule.cs プロジェクト: balu92/Fougerite
        private void PlayerKilled(DeathEvent deathEvent)
        {
            try
            {
                if (!(deathEvent.Attacker is Fougerite.Player))
                    return;

                Fougerite.Player player = (Fougerite.Player) deathEvent.Attacker;
                Fougerite.Player victim = (Fougerite.Player) deathEvent.Victim;

                string weapon = deathEvent.WeaponName;
                if ((deathEvent.DamageType == "Bullet"
                     &&
                     (weapon == "HandCannon" && weapon == "Pipe Shotgun" && weapon == "Revolver" &&
                      weapon == "9mm Pistol" &&
                      weapon == "P250" && weapon == "Shotgun" && weapon == "Bolt Action Rifle" && weapon == "M4" &&
                      weapon == "MP5A4"))
                    || (deathEvent.DamageType == "Melee" && (int) (Math.Round(deathEvent.DamageAmount)) == 75
                        && string.IsNullOrEmpty(weapon)))
                {
                    Vector3 attacker_location = player.Location;
                    Vector3 victim_location = ((Fougerite.Player) deathEvent.Victim).Location;
                    float distance =
                        (float) Math.Round(Util.GetUtil().GetVectorsDistance(attacker_location, victim_location));
                    if (distance > RangeOf(weapon) && RangeOf(weapon) > 0)
                    {
                        player.Kill();
                        BanCheater(player, "AutoAIM. Gun: " + weapon + " Dist: " + distance);
                        Server.GetServer()
                            .BroadcastFrom(EchoBotName,
                                player.Name + " shooted " + victim.Name + " from " + distance + "m.");
                        Log("AutoAIM: " + player.Name + ". Gun: " + weapon + " Dist: " + distance);
                        player.Disconnect();
                        victim.TeleportTo(attacker_location.x, attacker_location.y, attacker_location.z);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
コード例 #4
0
ファイル: ServerTests.cs プロジェクト: balu92/Fougerite
 void PlayerKilled(DeathEvent deathEvent)
 {
 }
コード例 #5
0
ファイル: MagmaPlugin.cs プロジェクト: balu92/Fougerite
 public void OnNPCKilled(DeathEvent evt)
 {
     Invoke("On_NPCKilled", evt);
 }
コード例 #6
0
ファイル: MagmaPlugin.cs プロジェクト: balu92/Fougerite
 public void OnPlayerKilled(DeathEvent evt)
 {
     Invoke("On_PlayerKilled", evt);
 }
コード例 #7
0
ファイル: Player.cs プロジェクト: balu92/Fougerite
        private void Hooks_OnPlayerKilled(DeathEvent de)
        {
            Contract.Requires(de != null);

            try
            {
                Fougerite.Player victim = de.Victim as Fougerite.Player;
                if (victim.GameID == this.GameID)
                {
                    this.justDied = true;
                }
            }
            catch (Exception ex)
            {
                this.invError = true;
                Logger.LogException(ex);
            }
        }
コード例 #8
0
ファイル: RustPPModule.cs プロジェクト: balu92/Fougerite
 void PlayerKilled(DeathEvent event2)
 {
     event2.DropItems = !RustPP.Hooks.KeepItem();
     if (!(event2.Attacker is NPC)) // Not NPC
     {
         Fougerite.Player attacker = event2.Attacker as Fougerite.Player;
         Fougerite.Player victim = event2.Victim as Fougerite.Player;
         if ((attacker.Name != victim.Name) && (Fougerite.Server.GetServer().FindPlayer(attacker.Name) != null))
             RustPP.Hooks.broadcastDeath(victim.Name, attacker.Name, event2.WeaponName);
     }
 }
コード例 #9
0
ファイル: Hooks.cs プロジェクト: balu92/Fougerite
        public static bool PlayerKilled(ref DamageEvent de)
        {
            try
            {
                DeathEvent event2 = new DeathEvent(ref de);
                if (OnPlayerKilled != null)
                    OnPlayerKilled(event2);

                return event2.DropItems;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return false;
            }
        }
コード例 #10
0
ファイル: Hooks.cs プロジェクト: balu92/Fougerite
 public static void NPCKilled(ref DamageEvent e)
 {
     try
     {
         DeathEvent de = new DeathEvent(ref e);
         if (OnNPCKilled != null)
             OnNPCKilled(de);
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }
コード例 #11
0
ファイル: V8Engine.cs プロジェクト: balu92/Fougerite
 void OnPlayerKilled(DeathEvent param0)
 {
     foreach (KeyValuePair<string, V8Plugin> plugin in plugins)
     {
         plugin.Value.Invoke("On_PlayerKilled", param0); // Deprecated
         plugin.Value.Invoke("OnPlayerKilled", param0);
     }
 }