Giter VIP home page Giter VIP logo

limiteddronerange's Introduction

Features

  • Limits how far RC drones can be controlled from computer stations
  • Allows configuring range limits per player using permissions
  • Displays a UI while piloting a drone, showing current and max range, and which changes color near max range

No-plugin alternative

Since the March 2023 Rust update, you can now control max drone range using the drone.maxcontrolrange ConVar. However, this plugin is still useful if you want to change max drone range for specific players.

Permissions

The following permissions come with the plugin's default configuration. Granting one to a player determines how far they can pilot drones away from computer stations, overriding the default. Granting multiple profiles to a player will cause only the last one to apply, based on the order in the config.

  • limiteddronerange.short -- 250m
  • limiteddronerange.medium -- 500m
  • limiteddronerange.long -- 1000m
  • limiteddronerange.unlimited -- No limit

You can add more profiles in the plugin configuration (ProfilesRequiringPermission), and the plugin will automatically generate permissions of the format limiteddronerange.<suffix> when reloaded.

Configuration

Default configuration:

{
  "DefaultMaxRange": 500,
  "ProfilesRequiringPermission": [
    {
      "PermissionSuffix": "short",
      "MaxRange": 250
    },
    {
      "PermissionSuffix": "medium",
      "MaxRange": 500
    },
    {
      "PermissionSuffix": "long",
      "MaxRange": 1000
    },
    {
      "PermissionSuffix": "unlimited",
      "MaxRange": 0
    }
  ],
  "UISettings": {
    "AnchorMin": "0.5 0",
    "AnchorMax": "0.5 0",
    "OffsetMin": "0 47",
    "OffsetMax": "0 47",
    "TextSize": 24,
    "DefaultColor": "0.75 0.75 0.75 1",
    "OutOfRangeColor": "1 0.2 0.2 1",
    "DynamicColors": [
      {
        "DistanceRemaining": 100,
        "Color": "1 0.5 0 1"
      },
      {
        "DistanceRemaining": 50,
        "Color": "1 0.2 0.2 1"
      }
    ],
    "SecondsBetweenUpdates": 0.5
  }
}
  • DefaultMaxRange -- Max range for players who do not have permission to any profiles in ProfilesRequiringPermission.
  • ProfilesRequiringPermission -- Each profile in this list generates a permission like limiteddronerange.<suffix>. Granting a profile to a player determines how far they can pilot drones away from the host computer station, overriding DefaultMaxRange.
    • PermissionSuffix -- Determines the generated permission of format limiteddronerange.<suffix>.
    • MaxRange -- Determines the max range for players with this profile.
  • UISettings -- Options to control the display of the UI.

Localization

{
  "UI.Distance": "{0}m / {1}m",
  "UI.OutOfRange": "OUT OF RANGE"
}

Recommended compatible plugins

Drone balance:

  • Drone Settings -- Allows changing speed, toughness and other properties of RC drones.
  • Targetable Drones -- Allows RC drones to be targeted by Auto Turrets and SAM Sites.
  • Limited Drone Range (This plugin) -- Limits how far RC drones can be controlled from computer stations.

Drone fixes and improvements:

  • Better Drone Collision -- Overhauls RC drone collision damage so it's more intuitive.
  • Auto Flip Drones -- Auto flips upside-down RC drones when a player takes control.
  • Drone Hover -- Allows RC drones to hover in place while not being controlled.

Drone attachments:

  • Drone Lights -- Adds controllable search lights to RC drones.
  • Drone Turrets -- Allows players to deploy auto turrets to RC drones.
  • Drone Storage -- Allows players to deploy a small stash to RC drones.
  • Ridable Drones -- Allows players to ride RC drones by standing on them or mounting a chair.

Developer Hooks

OnDroneRangeLimit

object OnDroneRangeLimit(Drone drone, ComputerStation station, BasePlayer player)
  • Called after a player has started controlling a drone, when this plugin is about to start limiting its max range
  • Returning false will prevent this plugin from limiting the drone's max range or showing a UI to the player
  • Returning null will result in the default behavior

limiteddronerange's People

Contributors

whetethunger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.