ArgumentNullException at GetBaseVehicleSettingsFixed

Hey there. I'm having a weird issue where players can't spawn vehicles after they purchased them. In RCON it's throwing the following error:

When I delete the data file it seemed to fix it for a little bit. Players say that /buy says they already own a vehicle and when they type /spawn it doesn't do anything in chat.

(15:31:52) | Failed to call hook 'CmdSpawnVehicle' on plugin 'VehicleLicence v1.7.32' (ArgumentNullException: Value cannot be null.
Parameter name: key)
  at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) [0x00008] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at Oxide.Plugins.VehicleLicence.GetBaseVehicleSettings (System.String vehicleType) [0x00000] in <c7ca953cfc4c429ba80ded85a0ae7b79>:0 
  at Oxide.Plugins.VehicleLicence.CanSpawn (BasePlayer player, Oxide.Plugins.VehicleLicence+Vehicle vehicle, System.Boolean bypassCooldown, System.String command, System.String& reason, UnityEngine.Vector3& position, UnityEngine.Quaternion& rotation) [0x00007] in <c7ca953cfc4c429ba80ded85a0ae7b79>:0 
  at Oxide.Plugins.VehicleLicence.SpawnVehicle (BasePlayer player, System.String vehicleType, System.Boolean bypassCooldown, System.String command) [0x000c7] in <c7ca953cfc4c429ba80ded85a0ae7b79>:0 
  at Oxide.Plugins.VehicleLicence.CmdSpawnVehicle (BasePlayer player, System.String command, System.String[] args) [0x001da] in <c7ca953cfc4c429ba80ded85a0ae7b79>:0 
  at Oxide.Plugins.VehicleLicence.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00fff] in <c7ca953cfc4c429ba80ded85a0ae7b79>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <e23ba2c0f246426296d81c842cbda3af>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <46ff2b534abb4b35952608167523b7ec>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <46ff2b534abb4b35952608167523b7ec>:0​

Same issue here. I just did a fresh plugin/config still same issue.

Same here. The issue seems to occur if you have an existing data file, or if you restart the plugin after a data file has been created and populated with some purchased vehicle licences.

Failed to call hook 'CmdUniversal' on plugin 'VehicleLicence v1.7.32' (ArgumentNullException: Value cannot be null.
Parameter name: key)
   at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) [0x00008] in <eae584ce26bc40229c1b1aa476bfa589>:0
   at System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
   at Oxide.Plugins.VehicleLicence.GetBaseVehicleSettings (System.String vehicleType) [0x00000] in <d862e0d691ea448b8f0728bc321ecbeb>:0
   at Oxide.Plugins.VehicleLicence.CanSpawn (BasePlayer player, Oxide.Plugins.VehicleLicence+Vehicle vehicle, System.Boolean bypassCooldown, System.String command, System.String& reason, UnityEngine.Vector3& position, UnityEngine.Quaternion& rotation) [0x00007] in <d862e0d691ea448b8f0
728bc321ecbeb>:0
   at Oxide.Plugins.VehicleLicence.HandleUniversalCmd (BasePlayer player, System.String vehicleType, System.Boolean bypassCooldown, System.String command) [0x0006c] in <d862e0d691ea448b8f0728bc321ecbeb>:0
   at Oxide.Plugins.VehicleLicence.CmdUniversal (BasePlayer player, System.String command, System.String[] args) [0x0005f] in <d862e0d691ea448b8f0728bc321ecbeb>:0
   at Oxide.Plugins.VehicleLicence.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00f13] in <d862e0d691ea448b8f0728bc321ecbeb>:0
   at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <e23ba2c0f246426296d81c842cbda3af>:0
   at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <46ff2b534abb4b35952608167523b7ec>:0
   at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <46ff2b534abb4b35952608167523b7ec>:0​

What type of vehicle did you all attempt to spawn?

Its with spawning any vehicle

Seemed like complaints started to roll in after restart. It seems like if you purchase vehicle, it will work after that. But if you reload the plugin or restart server it will break the ones purchased.

HeyThere

Seemed like complaints started to roll in after restart. It seems like if you purchase vehicle, it will work after that. But if you reload the plugin or restart server it will break the ones purchased.

Exactly here. If I wipe the data file, everyone is good. Once we have a restart all purchased vehicles from before restart are bugged and new purchases are fine. My fix so far is to wipe data every time we restart server and I made vehicles free in the meantime.

One more detail. This issue I believe started with v1.7.30. According to my notes when I updated to this version last wipe it caused the same issue, so I reverted back to an older version. Old version no longer works because of rust updates.

HeyThere

One more detail. This issue I believe started with v1.7.30. According to my notes when I updated to this version last wipe it caused the same issue, so I reverted back to an older version. Old version no longer works because of rust updates.

Latest update did not cause the issue, the change was very minor and only related to trains.

xcR82av9BOFlBfh.png Wulf

Latest update did not cause the issue, the change was very minor and only related to trains.

Correct, 1.7.30 was about 3 weeks ago.

I had same issue, redid my json cuase it was not working with the settings way it was ended up getting plugin to work but now most vehicles can only be pushed and not mounted

Have you disabled it?  "Store Vehicle On Plugin Unloaded / Server Restart": false,

ruIwson9GtxeqdU.jpg Arainrr

Have you disabled it?  "Store Vehicle On Plugin Unloaded / Server Restart": false,

Mine is disabled yes.

ruIwson9GtxeqdU.jpg Arainrr

Have you disabled it?  "Store Vehicle On Plugin Unloaded / Server Restart": false,

Thanks for the info Arainrr.
I also had this setting disabled. I've enabled it now and vehicles seem to be spawning again.
I had incorrectly assumed it meant "store (/kill) all active vehicles on the map when the plugin or server restarts".

I'm not sure why I only got hit with an issue now.
I upgraded from version 1.7.29 to 1.7.32.
I checked through my backups, and I've always had this setting set to "false", but vehicles previously seemed to spawn fine after restarts.

Anyway - that seems to have resolved it (for me, anyway).
Thanks for the great plugin - my players love it.

Now it should be fixed 🤪

Locked automatically