Example #1
0
 private void TrampolineThink(Entity player)
 {
     OnInterval(100, () =>
     {
         try
         {
             foreach (var ent in usables)
             {
                 if (player.Origin.DistanceTo(ent.Origin) >= ent.GetField <int>("range"))
                 {
                     continue;
                 }
                 if (ent.GetField <string>("usabletype") == "trampoline" && player.Call <int>("IsOnGround") == 0 && player.IsAlive && !player.CurrentWeapon.Contains("ac130") && !player.CurrentWeapon.Contains("killstreak") && !player.CurrentWeapon.Contains("remote"))
                 {
                     BoxFunction.UseTrampoline(ent, player);
                 }
             }
         }
         catch (Exception)
         {
         }
         return(true);
     });
 }
Example #2
0
        private void UsableThink(Entity player)
        {
            try
            {
                foreach (var ent in usables)
                {
                    if (player.Origin.DistanceTo(ent.Origin) < ent.GetField <int>("range"))
                    {
                        if (player.IsAlive && !player.CurrentWeapon.Contains("ac130") && !player.CurrentWeapon.Contains("killstreak") && !player.CurrentWeapon.Contains("remote"))
                        {
                            switch (ent.GetField <string>("usabletype"))
                            {
                            case "door":
                                BoxFunction.UseDoor(ent, player);
                                break;

                            case "paydoor":
                                BoxFunction.UsePayDoor(ent, player);
                                break;

                            case "turret":
                                break;

                            case "sentry":
                                break;

                            case "gl":
                                break;

                            case "sam":
                                break;

                            case "zipline":
                                BoxFunction.UseZipline(ent, player);
                                break;

                            case "teleporter":
                                if (Call <int>("getdvarint", "scr_aiz_power") == 1)
                                {
                                    BoxFunction.UseTeleporter(ent, player);
                                }
                                break;

                            case "power":
                                BoxFunction.UsePower(ent, player);
                                break;

                            case "ammo":
                                BoxFunction.UseAmmo(player);
                                break;

                            case "gambler":
                                BoxFunction.UseGambler(ent, player);
                                break;

                            case "airstrike":
                                if (Call <int>("getdvarint", "scr_aiz_power") == 1)
                                {
                                    BoxFunction.UseAirstrike(player);
                                }
                                break;

                            case "perk":
                                if (Call <int>("getdvarint", "scr_aiz_power") == 1)
                                {
                                    BoxFunction.UsePerk(player, ent.GetField <PerkCola>("perk"));
                                }
                                break;

                            case "randomperk":
                                if (Call <int>("getdvarint", "scr_aiz_power") == 1)
                                {
                                    BoxFunction.UseRandomPerk(ent, player);
                                }
                                break;

                            case "gobblegum":
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
            }
        }