コード例 #1
0
ファイル: AdminTools.cs プロジェクト: TheMajical/RustLegacy
 private void OnEntityHurt(Fougerite.Events.HurtEvent he)
 {
     if (he.AttackerIsPlayer && !he.IsDecay)
     {
         Fougerite.Player attacker = (Fougerite.Player)he.Attacker;
         if (DataStore.GetInstance().ContainsKey("OwnerSave", attacker.SteamID))
         {
             if (he.WeaponName == "Shotgun")
             {
                 attacker.MessageFrom(Name, "You Can't use Shotgun in this mode!");
                 return;
             }
             attacker.Notice("Entity Loc + Owner Saved!");
             string logtext = " " + he.Entity.Name + " Owner: " + he.Entity.OwnerName + " (" + he.Entity.OwnerID + ") | X: " + he.Entity.X + " Y: " + he.Entity.Y + " Z: " + he.Entity.Z + " Saved by " + attacker.Name + "";
             Log(logtext, "SavedOwners");
             return;
         }
         if (DataStore.GetInstance().ContainsKey("OwnerMode", attacker.SteamID))
         {
             if (he.WeaponName == "Shotgun")
             {
                 attacker.MessageFrom(Name, "You Can't use Shotgun in this mode!");
                 return;
             }
             attacker.Notice(he.Entity.Name + "Is Owned by " + he.Entity.OwnerName);
             attacker.MessageFrom(Name, "[color #42f5b3]Owner: [color #f5e042]" + he.Entity.OwnerName + " [color #42f5b3]" + he.Entity.OwnerID);
             return;
         }
     }
 }
コード例 #2
0
 public void OnPlayerHurt(Fougerite.Events.HurtEvent he)
 {
     if (he.Attacker != null && he.Victim != null)
     {
         if (he.Attacker is Fougerite.Player && he.Victim is Fougerite.Player)
         {
             Fougerite.Player victim   = (Fougerite.Player)he.Victim;
             Fougerite.Player attacker = (Fougerite.Player)he.Attacker;
             if (DataStore.GetInstance().ContainsKey("AdminDuty", attacker.SteamID) && attacker != victim)
             {
                 he.DamageAmount = 0f;
                 attacker.MessageFrom(Name, "[color #42b3f5]You [color #45f542]Can't [color #42b3f5]Damage anyone while you are in Admin-Duty!");
                 attacker.Notice("You Can't Damage anyone in Admin-Duty!");
                 victim.MessageFrom("AntiAbuse", "[color #42b3f5]Admin [color #45f542]" + attacker.Name + " [color #42b3f5]tried to [color #45f542]Damage [color #42b3f5]You in Admin-Duty!");
             }
         }
     }
 }
コード例 #3
0
 public void OnEntityHurt(Fougerite.Events.HurtEvent hurtEvent)
 {
     try
     {
         if (!hurtEvent.IsDecay && hurtEvent.AttackerIsPlayer)
         {
             Fougerite.Player player = hurtEvent.Attacker as Fougerite.Player;
             if (DestroyMode.Contains(player.SteamID))
             {
                 if (hurtEvent.Entity != null)
                 {
                     hurtEvent.Entity.Destroy();
                 }
             }
         }
     }
     catch
     {
     }
 }
コード例 #4
0
        private void OnEntityHurt(Fougerite.Events.HurtEvent he)
        {
            if (he.AttackerIsPlayer && !he.IsDecay)
            {
                Fougerite.Player attacker = (Fougerite.Player)he.Attacker;

                ulong id  = he.Entity.UOwnerID;
                ulong id2 = attacker.UID;

                if (DataStore.GetInstance().ContainsKey("RemoveTool", attacker.SteamID))
                {
                    if (he.WeaponName == "Shotgun")
                    {
                        attacker.MessageFrom(Name, "[color #fc0313]You Can't Use Shotgun!");
                        return;
                    }
                    if (he.Entity.Name == "MetalBarsWindow")
                    {
                        attacker.MessageFrom(Name, "You [color #fc0313]Can't[color white] Remove Metal Window Bars!");
                        return;
                    }
                    if (IsShared(id, id2) || id == id2)
                    {
                        if (!IsNotEligible(he.Entity))
                        {
                            he.Entity.Destroy();
                            attacker.Inventory.AddItem(EntityList[he.Entity.Name]);
                            attacker.InventoryNotice("+1 " + EntityList[he.Entity.Name]);
                        }
                        else
                        {
                            attacker.MessageFrom(Name, "[color #fc0313]Can't Remove this cause there is some Pillars/Ceilings on it!");
                        }
                    }
                    else
                    {
                        attacker.MessageFrom(Name, "This " + he.Entity.Name + " Owner [color #fc0313]has not[color white] Shared you!");
                    }
                }
            }
        }