Can't get this workingSolved

Hey, don't seem to be able to get this working with modular cars?

It's not enabled by default. It has to be turned on in the config. You also have to specify the chance for a turret to spawn on each module type. After that, new car spawns may have turrets on them.

Please paste your config.

Here you go. Never spawns. Even if I change the chance values. Permissions are fine

{
  "DefaultLimitPerCar": 4,
  "EnableTurretPickup": true,
  "SpawnWithCar": {
    "NaturalCarSpawns": {
      "Enabled": true
    },
    "OtherCarSpawns": {
      "Enabled": true,
      "RequirePermission": true
    },
    "SpawnChanceByModule": {
      "vehicle.1mod.cockpit": 1,
      "vehicle.1mod.cockpit.armored": 1,
      "vehicle.1mod.cockpit.with.engine": 1,
      "vehicle.1mod.engine": 1,
      "vehicle.1mod.flatbed": 1,
      "vehicle.1mod.passengers.armored": 1,
      "vehicle.1mod.rear.seats": 1,
      "vehicle.1mod.storage": 1,
      "vehicle.1mod.taxi": 1,
      "vehicle.2mod.flatbed": 1,
      "vehicle.2mod.fuel.tank": 1,
      "vehicle.2mod.passengers": 1
    }
  },
  "AutoTurretPositionByModule": {
    "vehicle.1mod.cockpit": {
      "x": 0.0,
      "y": 1.39,
      "z": -0.3
    },
    "vehicle.1mod.cockpit.armored": {
      "x": 0.0,
      "y": 1.39,
      "z": -0.3
    },
    "vehicle.1mod.cockpit.with.engine": {
      "x": 0.0,
      "y": 1.39,
      "z": -0.85
    },
    "vehicle.1mod.engine": {
      "x": 0.0,
      "y": 0.4,
      "z": 0.0
    },
    "vehicle.1mod.flatbed": {
      "x": 0.0,
      "y": 0.06,
      "z": 0.0
    },
    "vehicle.1mod.passengers.armored": {
      "x": 0.0,
      "y": 1.38,
      "z": -0.31
    },
    "vehicle.1mod.rear.seats": {
      "x": 0.0,
      "y": 1.4,
      "z": -0.12
    },
    "vehicle.1mod.storage": {
      "x": 0.0,
      "y": 0.61,
      "z": 0.0
    },
    "vehicle.1mod.taxi": {
      "x": 0.0,
      "y": 1.38,
      "z": -0.13
    },
    "vehicle.2mod.flatbed": {
      "x": 0.0,
      "y": 0.06,
      "z": -0.7
    },
    "vehicle.2mod.fuel.tank": {
      "x": 0.0,
      "y": 1.28,
      "z": -0.85
    },
    "vehicle.2mod.passengers": {
      "x": 0.0,
      "y": 1.4,
      "z": -0.9
    }
  }
}​

Chances are 0 to 100, as stated in the documentation. Setting them to 1 like you have will very rarely spawn turrets. You said "even if I change the chance values", but not sure if that means you tried setting them higher than 1.

If you did try them at 100 for example, how were you spawning the cars when testing? Spawning cars with the spawn console command will consider them to be OtherCarSpawns, and they will not have an owner so the permission check won't pass, so those will never spawn with turrets using the config you provided.

If you are spawning a car via a plugin such as Spawn Modular Car or Vehicle License, they should be setting the owner, so the only other thing needed would be the permissions to the module type.

ah crap. I read that wrong - thought it was fractions like 0.2 0.3 etc.. ill try that

Merged post

Yep - all good. If we could make them spawn with gun/ammo as a config line would be epic (or an option for unlimited ammo)

infusednz 

Yep - all good. If we could make them spawn with gun/ammo as a config line would be epic (or an option for unlimited ammo)

I have no plans to add that because Turret Manager and Turret Loadouts (more advanced) already perform that functionality. This plugin is made explicitly compatible so that those plugins will detect when a player adds a turret to a car or spawns a car with turrets. As long as the player has the permission and a selected turret loadout, the turret will be filled and possibly toggled on.

There is no auto filling or toggling of turrets on natural car spawns, though, as the way those plugins detect the turret being added is via an Oxide hook for deploying items, which requires a player, which this plugin can't provide in that case. Fixable, but it seems like an acceptable limitation for now.
Locked automatically