A simple plugin to spawn a mini copter for yourself. Limits to one mini copter per player with optional cooldown (using permission).
Uses: NoEscape (optional)
myminicopter.spawn-- Allows player to spawn a mini copter (/mymini)myminicopter.fetch-- Allows player to use /gmini retrieve their mini coptermyminicopter.where-- Allows player to use /wmini to locate their mini copter (NEW!)myminicopter.admin-- Allows an admin to run console commands (may change)myminicopter.cooldown-- Adds a cooldown to playermyminicopter.unlimited-- Player can fly without fuel usage (will need to add at least 1 LGF unless "Allow unlimited to use fuel tank" is set to false)myminicopter.canhover-- Player can enable or disable hover mode
/mymini-- Spawn a mini copter/nomini-- Despawn mini copter/wmini-- Find mini copter/gmini-- Get/fetch mini copter/hmini-- Enable/disable hovering
spawnminicopter <player ID>killminicopter <player ID>
(void) SpawnMyMinicopter (BasePlayer player)
(void) KillMyMinicopterPlease (BasePlayer player)
no return value;{
"Global": {
"allowWhenBlocked": false,
"useCooldown": true,
"copterDecay": false,
"allowDamage": true,
"killOnSleep": false,
"allowFuelIfUnlimited": false,
"allowDriverDismountWhileFlying": true,
"allowPassengerDismountWhileFlying": true,
"stdFuelConsumption": 0.25,
"cooldownmin": 60.0,
"mindistance": 0.0,
"gminidistance": 0.0,
"minDismountHeight": 7.0,
"startingFuel": 0.0,
"Prefix": "[My MiniCopter] :",
"TimedHover": false,
"DisableHoverOnDismount": true,
"EnableRotationOnHover": true,
"PassengerCanToggleHover": false,
"HoverWithoutEngine": false,
"UseFuelOnHover": true,
"HoverDuration": 60.0,
"UseKeystrokeForHover": false,
"HoverKey": 134217728
},
"VIPSettings": {
"myminicopter.viplevel1": {
"unlimited": false,
"canloot": true,
"stdFuelConsumption": 0.15,
"startingFuel": 20.0,
"cooldownmin": 120.0,
"mindistance": 0.0,
"gminidistance": 0.0
}
},
"Version": {
"Major": 0,
"Minor": 4,
"Patch": 7
}
}Global:
allowWhenBlocked-- Set to true to allow player to use /mymini while building blockeduseCooldown-- Enforce a cooldown for minutes between use of /mymini.useNoEscape-- Use the NoEscape plugin to check and prevent command use while "raid blocked" per that plugincopterDecay-- Enable decayallowDamage-- Enable/allow damage (old default)killOnSleep-- Kill the copter when the user leaves the serverallowFuelIfUnlimited-- Allow unlimited permission users to add fuel anyway.allowDriverDismountWhileFlying-- Allow the driver to dismount while flying above minDismountHeight.allowPassengerDismountWhileFlying-- Allow passenger to dismount while flying above minDismountHeight.stdFuelConsumption-- Adjust fuel consumption per second from standard amount (0.25f)cooldownmin-- Minutes to wait between usage of /myminimindistance-- Miniumum distance to copter for using /nominigminidistance-- Miniumum distance to copter for using /gminiminDismountHeight-- Miniumum height for dismount (for allow rules above)startingFuel-- How much fuel to start with for non-unlimited permission players (default 0)Prefix-- Prefix for chat messages (default [MyMiniCopter: ])TimedHover-- Use a timer to limit how long a copter can remain in hover modeDisableHoverOnDismount-- Disable hover if no players are seatedEnableRotationOnHover-- Allow the driver to rotate the copter while hoveringPassengerCanToggleHover-- Allow the passenger to toggle hoveringHoverWithoutEngine-- Hover with engine stoppedUseFuelOnHover-- Use fuel while hoveringHoverDuration-- How long the copter will hover if TimedHover is trueUseKeystrokeForHover-- Allow use of middle mouse button (by default) to toggle hoveringHoverKey-- Set the key used for hover toggling (default is middle mouse button)
Set "Value in meters" for gmini or nomini to 0 to disable the requirement (default).
For each level of VIP access you want, edit or create a copy of the default entry in the config:
"VIPSettings": {
"myminicopter.viplevel1": {
"unlimited": false,
"canloot": true,
"stdFuelConsumption": 0.15,
"startingFuel": 20.0,
"cooldownmin": 120.0,
"mindistance": 0.0,
"gminidistance": 0.0
},
"myminicopter.viplevel2": {
"unlimited": true,
"canloot": false,
"stdFuelConsumption": 0.0,
"startingFuel": 20.0,
"cooldownmin": 240.0,
"mindistance": 0.0,
"gminidistance": 0.0
}
}The setting above called myminicopter.viplevel1 is the name of the permission to assign to give a user or group this access.
Below this are the things you can change vs. the default settings. Overall, they should work the same as the default settings.
You can set the key for each value simply to viplevel1, maxminis, etc. The code will automatically add myminicopter. to the beginning as is required.
-
The player/owner must have the myminicopter.hover permission.
-
Some code was borrowed from HelicopterHover but modified for our purposes. Essentially, the parts that maintain height and control fuel usage are from that plugin. See the plugin code for more details.
-
Fuel usage is still disabled if the player has the unlimited permission.
-
While hovering, if UseKeystrokeForHover is enabled, the driver can click the middle mouse button to toggle hovering on and off.
-
Also, if UseKeystrokeForHover is enabled, the BACK button (S) will become the stabilzation button while hovering. This allows the player to automatically right the minicopter.
-
If UseKeystrokeForHover is NOT enabled (false), then neither of these functions work. To toggle hovering in that case, use the /hmini chat command.
-
If you want to use another key instead of MMB, you must use one that the game will actually send. This is generally limited to WASD, Shift, Ctrl, and perhaps a few others. Be careful not to interfere with other player motion commands, map, etc.
- health workaround
- check console commands input/NRE
