Flies for a few seconds than lands

I have a player that gets into his spawned mini, he takes off, then a few seconds later, it stops, like it's run out of fuel. He is the only one this happens to. Any idea?

This sounds like it's related to the unlimited fuel functionality. If you grant a player the permission for unlimited fuel (spawnmini.unlimitedfuel), the way it works is that their mini will spawn with 1 low grade, with fuel consumption set to 0. If the fuel consumption hadn't been set to 0 for some reason, then the mini would run out of fuel moments later, as you described.

I'm not aware of any bugs with the unlimited fuel functionality, but after glancing at the code, I see there's an edge case that could happen.

  • If the player spawned the mini prior to a server restart, then experienced this issue after the restart, this issue could happen if any of the following events had occurred between the time of the server restart and the time that they tried to fly it
    • If the data file somehow lost track of the mini (not supposed to happen)
    • If the minicopter OwnerID changed to 0 (not supposed to happen)
    • If the player lost the spawnmini.unlimitedfuel permission (most likely)
  • If the player spawned the mini immediately before trying to fly it, then the root cause is probably another plugin interfering

Well, he's the only player this is happening to and all players that have the permission to spawn the mini have the unlimited fuel and everyone is able to spawn the mini and then fly immediately, so I assumue it's one of the situations you described. I will check the data file. 

Merged post

I'm not sure what to check. The data file doesn't show much:

{
  "playerMini": {},
  "cooldown": {
    "76561############": "2022-06-04T19:56:15.3077263-04:00",
    "76561############": "2022-06-11T02:37:22.5492349-04:00",
    "76561############": "2022-06-18T19:56:29.0065359-04:00"
  }
}​

I'm not sure why anyone has a cool down because everyone with the spawn mini access has no cool down. Is there another data file? While I am posting this, I have a mini that is spawned. I had assumed my information would appear in the "playermini" line?

EDIT: My mini is showing in the data file now:

"76561DELETED": 284779660

I am waiting for him to spawn his mini again.



Merged post

He spawned his mini and now the data file looks like this. Appears to be ok. His mini is the one listed under playerMini:

{
  "playerMini": {
    "76561############": 284881320
  },
  "cooldown": {
    "76561############": "2022-06-04T19:56:15.3077263-04:00",
    "76561############": "2022-06-11T02:37:22.5492349-04:00",
    "76561############": "2022-06-18T19:56:29.0065359-04:00"
  }
}​


Merged post

Here's something interesting... I switched to the spawnable mini plugin on another site and he still has the same issue. So, this isn't plugin specific. Any clue why this would happen with him?

That is the correct data file. It records the time that each player spawned a mini, even if they have the no-cooldown permission, in case they lose the no-cooldown permission. What you are looking for is whether that player's steam id is in the playerMini section. It is, so there is no issue with the data file.

Could you verify that the minicopter has their OwnerID set?

At this point, my only guess is that another plugin is affecting their specific minicopter, such as by altering the fuel consumption of it.

I can verify that the player in question's Steam ID was in the data file while his mini was deployed. I don't know how to verify that the minicopter has the OwnerID set.  How do I do that?

I don't know how a plugin can only affect 1 player's mini and no others. I have the Mini Copter Options plugin. I disabled that and they still had the issue. I tried another spawnable mini plugin and they still had the issue. No one else has this issue, only this 1 player. 

You can check the minicopter's OwnerID by running ent who in the F1 client console while aiming at it.

I wonder if there's some sort of issue with that player specifically (perhaps client-side), as opposed to a plugin causing the issue. Has any other player tried to fly their minicopter, and has that player tried to fly any other minicopter?

I finally was able to check this. The mini IS owned. It shows the player's UID with that command. I was able to get into the mini and fly it and so was one of his team mates, but for him, he flew for a few seconds and it acted like it ran out of gas.

Ok, so it sounds like it's not running out of fuel. There's probably just something wrong with that player. Not sure what, though.

Another thing you could try is to run spawn minicopter in the client F1 console, add some fuel to that mini, and see if the same thing happens when that player tries to fly it. Also pay attention to the amount of fuel after it falls. If it falls, and if there is still fuel in it, then there's got to be something wrong with that player.

This was actually another player that came to me last night with the same problem as the previous player. I will see if I can catch him on the server and test that out.

Merged post

I spawned in a heli with that command and he was able to fly it. I confirmed that his spawnable heli showed his GUI when I used the ent who command. 

So, any idea why a player couldn't fly a spawnable heli?

No idea. I've already analyzed this problem remotely to the full extent feasible. Given that there are no known issues with the plugin, and no obvious logic errors which could cause this, I don't see this back and forth worth continuing.

The most efficient way to continue debugging this would be for me to see the issue first hand and write some custom code into the plugin or into a debug plugin to analyze the state of the player and minicopter to determine which assumptions aren't being met. This process usually requires a few attempts of editing the code and reuploading to test again, but should overall conclude in under an hour. If you have a test server where you can reproduce this issue and can give me access, that's how I suggest we move forward.

I don't know how I'd reproduce this error, as it seems to be random. It doesn't affect every player with a spawnable mini. Only 2 of the players so far. I'm able to fly my spawnable mini without any issue.

As mentioned over Discord DMs, I'm pretty sure this is due to a conflict with the Skill Tree plugin, since that plugin provides a perk that affects the fuel consumption rate of helicopters. The Spawn Mini plugin enables unlimited fuel by setting the fuel consumption rate to 0, and the Skill Tree plugin works by overriding the fuel consumption rate to a non-zero value. This hypothesis also explains why only some players were affected, because those players probably acquired that fuel consumption perk.

I've created a pull request on GitHub to change how Spawn Mini implements unlimited fuel, which should avoid this conflict.
https://github.com/Spookywooky3/SpawnMini/pull/13