CarCommander

CarCommander 0.2.76

Fix for Rust update
First pass at preventing wall glitching when exiting vehicle
Fixed trunks being destroyed when buildings around them breaking
Added config options for vehicle decay when inactive
Disable trunk box removal
The config has changed! See below for information regarding updating your config

Changed security related config options
Added option to require ignition key to lock the trunk
Added option to randomise whether a player gets a ignition key when they first enter the car
Added option to allow players to copy ignition keys
Added trunk locks, keys/codes and white listed players to persistence
Added missing message regarding key copying
Added empty message in UI when out of fuel

Config Changes (Delete your whole "Security Options" section before proceeding)
C#:
{
  "Active Item Options": {
    "Driver - Disable all held items": true,
    "Driver - List of disallowed held items (item shortnames)": [],
    "Passenger - Disable all held items": false,
    "Passenger - List of disallowed held items (item shortnames)": [
      "explosive.timed",
      "rocket.launcher",
      "surveycharge",
      "explosive.satchel"
    ]
  },
  "Button Configuration": {
    "Accelerate": "FORWARD",
    "Brake / Reverse": "BACKWARD",
    "Hand Brake": "SPRINT",
    "Open fuel tank": "FIRE_THIRD",
    "Open inventory": "RELOAD",
    "Toggle lights": "RELOAD",
    "Turn Left": "LEFT",
    "Turn Right": "RIGHT"
  },
  "Collision Options": {
    "Collision damage multiplier": 1.0,
    "Enable collision damage system": true
  },
  "Fuel Options": {
    "Amount of fuel to give spawned vehicles (maximum)": 50,
    "Amount of fuel to give spawned vehicles (minimum)": 10,
    "Fuel consumption rate (seconds per litre)": 10,
    "Fuel type (item shortname)": "lowgradefuel",
    "Requires fuel": true,
    "Spawn vehicles with fuel": true
  },
  "Inventory Options": {
    "Drop inventory on death": true,
    "Enable inventory system": true,
    "Inventory size (max 36)": 36
  },
  "Movement Settings": {
    "Anti Roll - Front horizontal force": 3500.0,
    "Anti Roll - Rear horizontal force": 3500.0,
    "Anti Roll - Vertical force": 500.0,
    "Engine - Acceleration torque": 600.0,
    "Engine - Brake  torque": 800.0,
    "Engine - Maximum speed": 90.0,
    "Engine - Reverse  torque": 500.0,
    "Steering - Automatically counter steer": false,
    "Steering - Max angle": 60.0,
    "Steering - Max angle at speed": 20.0,
    "Suspension - Damper": 2000.0,
    "Suspension - Distance": 0.2,
    "Suspension - Force": 40000.0,
    "Suspension - Target position (min 0, max 1)": 0.4
  },
  "Passenger Options": {
    "Allow passengers": true,
    "Require passenger to be a clan mate (Clans)": true,
    "Require passenger to be a friend (FriendsAPI)": true
  },
  "Repair Options": {
    "Amount of damage repaired per hit": 30,
    "Amount of item required to repair": 10,
    "Repair system enabled": true,
    "Shortname of item required to repair": "scrap"
  },
  "Security Options": { // Add from this line
    "Enable ignition systems": true,
    "Hotwire options": {
      "Allow players to hotwire vehicles": true,
      "Amount of time it takes per hotwire attempt (seconds)": 45,
      "Chance of successfully hotwiring a vehicle (1 in X chance)": 5,
      "Deal shock damage on failed hotwire attempts": true
    },
    "Ignition options": {
      "Allow players to copy a ignition key": true,
      "Chance of getting a key on entrance (1 in X)": 1,
      "Give the first player to enter the vehicle a key": true
    },
    "Trunk lock options": {
      "Allow locks to be placed on the trunk": true,
      "Only allow locks to be placed if the player has the ignition key": true
    }
  }, // To this line
  "Spawnable Options": {
    "Enable automatic vehicle spawning": true,
    "Maximum spawned vehicles at any time": 5,
    "Spawnfile name": "",
    "Time between autospawns (seconds)": 1800,
    "Use RandomSpawns for spawn locations": false
  },
  "UI Options": {
    "Fuel settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.096,
      "Position - Y minimum": 0.06,
      "Status alpha": 1.0,
      "Status color (hex)": "#ce422b"
    },
    "Health settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.135,
      "Position - Y minimum": 0.1,
      "Status alpha": 0.6,
      "Status color (hex)": "#ce422b"
    }
  }
}
  • Like
Reactions: NietTeSerieus
Possible solution for cars becoming useless when you are in them on plugin reload
Fix for OnEntityTakeDamage error

2.0.0 Patch notes:
The config has changed!
See below for information regarding updating your config

Added proper trunk container (walk to the back and open it)
Added option to allow lock placement on the trunk
Added optional keyed ignition system - This gives the first player in the vehicle a key coded for that car, which they will need to hang on to to drive it in the future
Added chat command to create more keys
Added hotwire system - Players can hotwire cars they dont have the key for, with the option to deal shock damage on failed attempts. Specify the chance and time it takes in the config
Added first pass at collision damage - You can toggle this in the config and also modify the damage amount. Damage is only applied to contact above the wheels
Added keycodes, health and hotwire status to persistence

Removed trunk access control key

Added checks for null data files (RestoreVehicle NRE)
Fixed autospawner bug that would stop the spawn timer when maximum cars had been reached.
Lowered the auto-spawn re-check timer when a car is already on the randomly chosen spawnpoint
Update player position manually to prevent "disappearing" cars when driving since the ingame method seems to be failing

Config Changes
Code:
{
  "Active Item Options": {
    "Driver - Disable all held items": true,
    "Driver - List of disallowed held items (item shortnames)": [],
    "Passenger - Disable all held items": false,
    "Passenger - List of disallowed held items (item shortnames)": [
      "explosive.timed",
      "rocket.launcher",
      "surveycharge",
      "explosive.satchel"
    ]
  },
  "Button Configuration": {
    "Accelerate": "FORWARD",
    "Brake / Reverse": "BACKWARD",
    "Hand Brake": "SPRINT",
    "Open fuel tank": "FIRE_THIRD",
    "Open inventory": "RELOAD",
    "Toggle lights": "RELOAD",
    "Turn Left": "LEFT",
    "Turn Right": "RIGHT"
  },
  "Collision Options": { // Add from this line
    "Collision damage multiplier": 1.0,
    "Enable collision damage system": true
  }, // To this line
  "Fuel Options": {
    "Amount of fuel to give spawned vehicles (maximum)": 50,
    "Amount of fuel to give spawned vehicles (minimum)": 10,
    "Fuel consumption rate (seconds per litre)": 10,
    "Fuel type (item shortname)": "lowgradefuel",
    "Requires fuel": true,
    "Spawn vehicles with fuel": true
  },
  "Inventory Options": {
    "Drop inventory on death": true,
    "Enable inventory system": true,
    "Inventory size (max 36)": 36
  },
  "Movement Settings": {
    "Anti Roll - Front horizontal force": 3500.0,
    "Anti Roll - Rear horizontal force": 3500.0,
    "Anti Roll - Vertical force": 500.0,
    "Engine - Acceleration torque": 600.0,
    "Engine - Brake  torque": 800.0,
    "Engine - Maximum speed": 90.0,
    "Engine - Reverse  torque": 500.0,
    "Steering - Automatically counter steer": false,
    "Steering - Max angle": 60.0,
    "Steering - Max angle at speed": 20.0,
    "Suspension - Damper": 2000.0,
    "Suspension - Distance": 0.2,
    "Suspension - Force": 40000.0,
    "Suspension - Target position (min 0, max 1)": 0.4
  },
  "Passenger Options": {
    "Allow passengers": true,
    "Require passenger to be a clan mate (Clans)": true,
    "Require passenger to be a friend (FriendsAPI)": true
  },
  "Repair Options": {
    "Amount of damage repaired per hit": 30,
    "Amount of item required to repair": 10,
    "Repair system enabled": true,
    "Shortname of item required to repair": "scrap"
  },
  "Security Options": { // Add from this line
    "Allow locks to be placed on the trunk": false,
    "Allow players create a ignition key": true,
    "Ignition hotwire options (requires ignition key enabled)": {
      "Allow players to hotwire vehicles": true,
      "Amount of time it takes per hotwire attempt (seconds)": 45,
      "Chance of successfully hotwiring a vehicle (1 in X chance)": 5,
      "Deal shock damage on failed hotwire attempts": true
    }
  }, // To this line
  "Spawnable Options": {
    "Enable automatic vehicle spawning": true,
    "Maximum spawned vehicles at any time": 5,
    "Spawnfile name": "",
    "Time between autospawns (seconds)": 1800,
    "Use RandomSpawns for spawn locations": false
  },
  "UI Options": {
    "Fuel settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.096,
      "Position - Y minimum": 0.06,
      "Status alpha": 1.0,
      "Status color (hex)": "#ce422b"
    },
    "Health settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.135,
      "Position - Y minimum": 0.1,
      "Status alpha": 0.6,
      "Status color (hex)": "#ce422b"
    }
  }
}
The config has changed! See below for information regarding updating your config

Added proper trunk container (walk to the back and open it)
Added option to allow lock placement on the trunk
Added optional keyed ignition system - This gives the first player in the vehicle a key coded for that car, which they will need to hang on to to drive it in the future
Added chat command to create more keys
Added hotwire system - Players can hotwire cars they dont have the key for, with the option to deal shock damage on failed attempts. Specify the chance and time it takes in the config
Added first pass at collision damage - You can toggle this in the config and also modify the damage amount. Damage is only applied to contact above the wheels
Added keycodes, health and hotwire status to persistence

Removed trunk access control key

Added checks for null data files (RestoreVehicle NRE)
Fixed autospawner bug that would stop the spawn timer when maximum cars had been reached.
Lowered the auto-spawn re-check timer when a car is already on the randomly chosen spawnpoint
Update player position manually to prevent "disappearing" cars when driving since the ingame method seems to be failing

Config Changes
Code:
{
  "Active Item Options": {
    "Driver - Disable all held items": true,
    "Driver - List of disallowed held items (item shortnames)": [],
    "Passenger - Disable all held items": false,
    "Passenger - List of disallowed held items (item shortnames)": [
      "explosive.timed",
      "rocket.launcher",
      "surveycharge",
      "explosive.satchel"
    ]
  },
  "Button Configuration": {
    "Accelerate": "FORWARD",
    "Brake / Reverse": "BACKWARD",
    "Hand Brake": "SPRINT",
    "Open fuel tank": "FIRE_THIRD",
    "Open inventory": "RELOAD",
    "Toggle lights": "RELOAD",
    "Turn Left": "LEFT",
    "Turn Right": "RIGHT"
  },
  "Collision Options": { // Add from this line
    "Collision damage multiplier": 1.0,
    "Enable collision damage system": true
  }, // To this line
  "Fuel Options": {
    "Amount of fuel to give spawned vehicles (maximum)": 50,
    "Amount of fuel to give spawned vehicles (minimum)": 10,
    "Fuel consumption rate (seconds per litre)": 10,
    "Fuel type (item shortname)": "lowgradefuel",
    "Requires fuel": true,
    "Spawn vehicles with fuel": true
  },
  "Inventory Options": {
    "Drop inventory on death": true,
    "Enable inventory system": true,
    "Inventory size (max 36)": 36
  },
  "Movement Settings": {
    "Anti Roll - Front horizontal force": 3500.0,
    "Anti Roll - Rear horizontal force": 3500.0,
    "Anti Roll - Vertical force": 500.0,
    "Engine - Acceleration torque": 600.0,
    "Engine - Brake  torque": 800.0,
    "Engine - Maximum speed": 90.0,
    "Engine - Reverse  torque": 500.0,
    "Steering - Automatically counter steer": false,
    "Steering - Max angle": 60.0,
    "Steering - Max angle at speed": 20.0,
    "Suspension - Damper": 2000.0,
    "Suspension - Distance": 0.2,
    "Suspension - Force": 40000.0,
    "Suspension - Target position (min 0, max 1)": 0.4
  },
  "Passenger Options": {
    "Allow passengers": true,
    "Require passenger to be a clan mate (Clans)": true,
    "Require passenger to be a friend (FriendsAPI)": true
  },
  "Repair Options": {
    "Amount of damage repaired per hit": 30,
    "Amount of item required to repair": 10,
    "Repair system enabled": true,
    "Shortname of item required to repair": "scrap"
  },
  "Security Options": { // Add from this line
    "Allow locks to be placed on the trunk": false,
    "Allow players create a ignition key": true,
    "Ignition hotwire options (requires ignition key enabled)": {
      "Allow players to hotwire vehicles": true,
      "Amount of time it takes per hotwire attempt (seconds)": 45,
      "Chance of successfully hotwiring a vehicle (1 in X chance)": 5,
      "Deal shock damage on failed hotwire attempts": true
    }
  }, // To this line
  "Spawnable Options": {
    "Enable automatic vehicle spawning": true,
    "Maximum spawned vehicles at any time": 5,
    "Spawnfile name": "",
    "Time between autospawns (seconds)": 1800,
    "Use RandomSpawns for spawn locations": false
  },
  "UI Options": {
    "Fuel settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.096,
      "Position - Y minimum": 0.06,
      "Status alpha": 1.0,
      "Status color (hex)": "#ce422b"
    },
    "Health settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.135,
      "Position - Y minimum": 0.1,
      "Status alpha": 0.6,
      "Status color (hex)": "#ce422b"
    }
  }
}
Quick fix for unsaved cars persisting through restarts
  • Like
Reactions: FunkyRusty
Fix for Rust update
Additional null checks for issues reported in support thread
  • Like
Reactions: Bolotnii_Doktor
The config has changed! See below for information regarding updating your config

Fixed issue with OnDeath function
Fixed issue with the "clearcars" command
Added config options to disable or limit what items a driver or passenger can hold in there hands whilst in a car. A driver shouldn't be able to driver and shoot a rocket launcher at the same time :p

Config Changes
C#:
{
  "Active Item Options": { // Add from this line
    "Driver - Disable all held items": true,
    "Driver - List of disallowed held items (item shortnames)": [],
    "Passenger - Disable all held items": false,
    "Passenger - List of disallowed held items (item shortnames)": [
      "explosive.timed",
      "rocket.launcher",
      "surveycharge",
      "explosive.satchel"
    ]
  },// To this line
  "Button Configuration": {
    "Accelerate": "FORWARD",
    "Brake / Reverse": "BACKWARD",
    "Hand Brake": "SPRINT",
    "Open fuel tank": "FIRE_THIRD",
    "Open inventory": "RELOAD",
    "Toggle lights": "RELOAD",
    "Turn Left": "LEFT",
    "Turn Right": "RIGHT"
  },
  "Fuel Options": {
    "Amount of fuel to give spawned vehicles (maximum)": 50,
    "Amount of fuel to give spawned vehicles (minimum)": 10,
    "Fuel consumption rate (seconds per litre)": 10,
    "Fuel type (item shortname)": "lowgradefuel",
    "Requires fuel": true,
    "Spawn vehicles with fuel": true
  },
  "Inventory Options": {
    "Drop inventory on death": true,
    "Enable inventory system": true,
    "Inventory size (max 36)": 36
  },
  "Movement Settings": {
    "Anti Roll - Front horizontal force": 3500.0,
    "Anti Roll - Rear horizontal force": 3500.0,
    "Anti Roll - Vertical force": 500.0,
    "Engine - Acceleration torque": 600.0,
    "Engine - Brake  torque": 800.0,
    "Engine - Maximum speed": 90.0,
    "Engine - Reverse  torque": 500.0,
    "Steering - Automatically counter steer": false,
    "Steering - Max angle": 60.0,
    "Steering - Max angle at speed": 20.0,
    "Suspension - Damper": 2000.0,
    "Suspension - Distance": 0.2,
    "Suspension - Force": 40000.0,
    "Suspension - Target position (min 0, max 1)": 0.4
  },
  "Passenger Options": {
    "Allow passengers": true,
    "Require passenger to be a clan mate (Clans)": true,
    "Require passenger to be a friend (FriendsAPI)": true
  },
  "Repair Options": {
    "Amount of damage repaired per hit": 30,
    "Amount of item required to repair": 10,
    "Repair system enabled": true,
    "Shortname of item required to repair": "scrap"
  },
  "Spawnable Options": {
    "Enable automatic vehicle spawning": true,
    "Maximum spawned vehicles at any time": 5,
    "Spawnfile name": "",
    "Time between autospawns (seconds)": 1800,
    "Use RandomSpawns for spawn locations": false
  },
  "UI Options": {
    "Fuel settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.096,
      "Position - Y minimum": 0.06,
      "Status alpha": 1.0,
      "Status color (hex)": "#ce422b"
    },
    "Health settings": {
      "Background alpha": 0.05,
      "Background color (hex)": "#F2F2F2",
      "Display to player": true,
      "Position - X maximum": 0.83,
      "Position - X minimum": 0.69,
      "Position - Y maximum": 0.135,
      "Position - Y minimum": 0.1,
      "Status alpha": 0.6,
      "Status color (hex)": "#ce422b"
    }
  }
}