Plugin not loadingSolved

My server is running and i upload the plugin (guardedcrate.cs) in the plugin folder. I shut down the server, modify the data .json to what i want. Start the server and when i type /gc start it says unknown command. What am i doing wrong?

Check your oxide/logs for errors and verify it is actually loaded.

Thanks a lot for answering. So i did checked into logs like you said and i found this:

03:24 [Error] Failed to initialize plugin 'GuardedCrate v1.4.5' (JsonReaderException: JsonToken EndArray is not valid for closing JsonType Object. Path 'Events[0]['CustomLoot (items to spawn in crate)'][12]', line 85, position 3.)

So if i understand with my non-developper brain, theres a mistake in my data .json file and thats why its not loading ?

Heres my data .json file:

{
  "Events": [{
        "EventDuration (duration the event will be active for)": 900.0,
        "EventName (event name)": "Low Level",
        "AutoHack (enables auto hacking of crates when an event is finished)": true,
        "AutoHackSeconds (countdown for crate to unlock in seconds)": 60.0,
        "UseKits (use custom kits plugin)": false,
        "Kits (custom kits)": [],
        "NpcName (custom name)": "Low Noob Guard",
        "NpcCount (number of guards to spawn)": 5,
        "NpcHealth (health guards spawn with)": 100.0,
        "NpcRadius (max distance guards will roam)": 15.0,
        "NpcAggression (max aggression distance guards will target)": 120.0,
        "MarkerColor (marker color)": "#32a844",
        "MarkerBorderColor (marker border color)": "#000000",
        "MarkerOpacity (marker opacity)": 0.9,
        "UseLoot (use custom loot table)": true,
        "MaxLootItems (max items to spawn in crate)": 6,
        "CustomLoot (items to spawn in crate)": [{
            "Shortname": "pistol.semiauto",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "ammo.pistol",
            "MinAmount": 32,
            "MaxAmount": 32
          },
          {
            "Shortname": "flamethrower",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "shotgun.double",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "ammo.shotgun",
            "MinAmount": 16,
            "MaxAmount": 16
          },
          {
            "Shortname": "hoodie",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "pants",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "shoes.boots",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "weapon.mod.silencer",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "gunpowder",
            "MinAmount": 250,
            "MaxAmount": 250
          },
          {
            "Shortname": "metal.refined",
            "MinAmount": 25,
            "MaxAmount": 25
          },
          {
            "Shortname": "metal.fragments",
            "MinAmount": 500,
            "MaxAmount": 500
          },
          {
            "Shortname": "hazmatsuit.spacesuit",
            "MinAmount": 1,
            "MaxAmount": 1
          ]
        },
        {
          "EventDuration (duration the event will be active for)": 900.0,
          "EventName (event name)": "Medium Level",
          "AutoHack (enables auto hacking of crates when an event is finished)": true,
          "AutoHackSeconds (countdown for crate to unlock in seconds)": 60.0,
          "UseKits (use custom kits plugin)": false,
          "Kits (custom kits)": [],
          "NpcName (custom name)": "Medium Noob Guard",
          "NpcCount (number of guards to spawn)": 10,
          "NpcHealth (health guards spawn with)": 150.0,
          "NpcRadius (max distance guards will roam)": 15.0,
          "NpcAggression (max aggression distance guards will target)": 120.0,
          "MarkerColor (marker color)": "#eddf45",
          "MarkerBorderColor (marker border color)": "#000000",
          "MarkerOpacity (marker opacity)": 0.9,
          "UseLoot (use custom loot table)": true,
          "MaxLootItems (max items to spawn in crate)": 6,
          "CustomLoot (items to spawn in crate)": [{
              "Shortname": "pistol.m92",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "ammo.pistol",
              "MinAmount": 64,
              "MaxAmount": 64
            },
            {
              "Shortname": "pistol.python",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "smg.thompson",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "weapon.mod.flashlight",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "burlap.gloves",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "roadsign.jacket",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "roadsign.kilt",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "coffeecan.helmet",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "gunpowder",
              "MinAmount": 500,
              "MaxAmount": 500
            },
            {
              "Shortname": "smg.2",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "metal.refined",
              "MinAmount": 50,
              "MaxAmount": 50
            },
            {
              "Shortname": "metal.fragments",
              "MinAmount": 1000,
              "MaxAmount": 1000
            },
            {
              "Shortname": "roadsign.gloves",
              "MinAmount": 1,
              "MaxAmount": 1
            ]
          },
          {
            "EventDuration (duration the event will be active for)": 1800.0,
            "EventName (event name)": "Hard Level",
            "AutoHack (enables auto hacking of crates when an event is finished)": true,
            "AutoHackSeconds (countdown for crate to unlock in seconds)": 60.0,
            "UseKits (use custom kits plugin)": false,
            "Kits (custom kits)": [],
            "NpcName (custom name)": "Hard Guard",
            "NpcCount (number of guards to spawn)": 15,
            "NpcHealth (health guards spawn with)": 200.0,
            "NpcRadius (max distance guards will roam)": 50.0,
            "NpcAggression (max aggression distance guards will target)": 150.0,
            "MarkerColor (marker color)": "#3060d9",
            "MarkerBorderColor (marker border color)": "#000000",
            "MarkerOpacity (marker opacity)": 0.9,
            "UseLoot (use custom loot table)": true,
            "MaxLootItems (max items to spawn in crate)": 6,
            "CustomLoot (items to spawn in crate)": [{
                "Shortname": "ammo.shotgun.fire",
                "MinAmount": 32,
                "MaxAmount": 32
              },
              {
                "Shortname": "ammo.pistol",
                "MinAmount": 96,
                "MaxAmount": 96
              },
              {
                "Shortname": "rifle.semiauto",
                "MinAmount": 1,
                "MaxAmount": 1
              },
              {
                "Shortname": "ammo.rifle",
                "MinAmount": 64,
                "MaxAmount": 64
              },
              {
                "Shortname": "weapon.mod.muzzleboost",
                "MinAmount": 1,
                "MaxAmount": 1
              },
              {
                "Shortname": "weapon.mod.muzzlebrake",
                "MinAmount": 1,
                "MaxAmount": 1
              },
              {
                "Shortname": "smg.mp5",
                "MinAmount": 1,
                "MaxAmount": 1
              },
              {
                "Shortname": "rifle.m39",
                "MinAmount": 1,
                "MaxAmount": 1
              },
              {
                "Shortname": "shotgun.spas12",
                "MinAmount": 1,
                "MaxAmount": 1
              },
              {
                "Shortname": "gunpowder",
                "MinAmount": 750,
                "MaxAmount": 750
              },
              {
                "Shortname": "metal.refined",
                "MinAmount": 75,
                "MaxAmount": 75
              },
              {
                "Shortname": "metal.fragments",
                "MinAmount": 1500,
                "MaxAmount": 1500
              },
              {
                "Shortname": "weapon.mod.lasersight",
                "MinAmount": 1,
                "MaxAmount": 1
              ]
            },
            {
              "EventDuration (duration the event will be active for)": 1800.0,
              "EventName (event name)": "Elite Level",
              "AutoHack (enables auto hacking of crates when an event is finished)": true,
              "AutoHackSeconds (countdown for crate to unlock in seconds)": 60.0,
              "UseKits (use custom kits plugin)": false,
              "Kits (custom kits)": [],
              "NpcName (custom name)": "Elite Noob Guard",
              "NpcCount (number of guards to spawn)": 20,
              "NpcHealth (health guards spawn with)": 350.0,
              "NpcRadius (max distance guards will roam)": 50.0,
              "NpcAggression (max aggression distance guards will target)": 180.0,
              "MarkerColor (marker color)": "#e81728",
              "MarkerBorderColor (marker border color)": "#000000",
              "MarkerOpacity (marker opacity)": 0.9,
              "UseLoot (use custom loot table)": true,
              "MaxLootItems (max items to spawn in crate)": 6,
              "CustomLoot (items to spawn in crate)": [{
                  "Shortname": "rifle.ak",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "ammo.rifle",
                  "MinAmount": 128,
                  "MaxAmount": 128
                },
                {
                  "Shortname": "rifle.l96",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "rifle.lr300",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "lmg.m249",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "rifle.bolt",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "weapon.mod.small.scope",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "metal.facemask",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "metal.plate.torso",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "gunpowder",
                  "MinAmount": 1000,
                  "MaxAmount": 1000
                },
                {
                  "Shortname": "metal.refined",
                  "MinAmount": 100,
                  "MaxAmount": 100
                },
                {
                  "Shortname": "metal.fragments",
                  "MinAmount": 2000,
                  "MaxAmount": 2000
                },
                {
                  "Shortname": "tactical.gloves",
                  "MinAmount": 1,
                  "MaxAmount": 1
                }
              ]
            }
          ]
        }
Reidfira

Thanks a lot for answering. So i did checked into logs like you said and i found this:

03:24 [Error] Failed to initialize plugin 'GuardedCrate v1.4.5' (JsonReaderException: JsonToken EndArray is not valid for closing JsonType Object. Path 'Events[0]['CustomLoot (items to spawn in crate)'][12]', line 85, position 3.)

So if i understand with my non-developper brain, theres a mistake in my data .json file and thats why its not loading ?

Heres my data .json file:

{
  "Events": [{
        "EventDuration (duration the event will be active for)": 900.0,
        "EventName (event name)": "Low Level",
        "AutoHack (enables auto hacking of crates when an event is finished)": true,
        "AutoHackSeconds (countdown for crate to unlock in seconds)": 60.0,
        "UseKits (use custom kits plugin)": false,
        "Kits (custom kits)": [],
        "NpcName (custom name)": "Low Noob Guard",
        "NpcCount (number of guards to spawn)": 5,
        "NpcHealth (health guards spawn with)": 100.0,
        "NpcRadius (max distance guards will roam)": 15.0,
        "NpcAggression (max aggression distance guards will target)": 120.0,
        "MarkerColor (marker color)": "#32a844",
        "MarkerBorderColor (marker border color)": "#000000",
        "MarkerOpacity (marker opacity)": 0.9,
        "UseLoot (use custom loot table)": true,
        "MaxLootItems (max items to spawn in crate)": 6,
        "CustomLoot (items to spawn in crate)": [{
            "Shortname": "pistol.semiauto",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "ammo.pistol",
            "MinAmount": 32,
            "MaxAmount": 32
          },
          {
            "Shortname": "flamethrower",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "shotgun.double",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "ammo.shotgun",
            "MinAmount": 16,
            "MaxAmount": 16
          },
          {
            "Shortname": "hoodie",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "pants",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "shoes.boots",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "weapon.mod.silencer",
            "MinAmount": 1,
            "MaxAmount": 1
          },
          {
            "Shortname": "gunpowder",
            "MinAmount": 250,
            "MaxAmount": 250
          },
          {
            "Shortname": "metal.refined",
            "MinAmount": 25,
            "MaxAmount": 25
          },
          {
            "Shortname": "metal.fragments",
            "MinAmount": 500,
            "MaxAmount": 500
          },
          {
            "Shortname": "hazmatsuit.spacesuit",
            "MinAmount": 1,
            "MaxAmount": 1
          ]
        },
        {
          "EventDuration (duration the event will be active for)": 900.0,
          "EventName (event name)": "Medium Level",
          "AutoHack (enables auto hacking of crates when an event is finished)": true,
          "AutoHackSeconds (countdown for crate to unlock in seconds)": 60.0,
          "UseKits (use custom kits plugin)": false,
          "Kits (custom kits)": [],
          "NpcName (custom name)": "Medium Noob Guard",
          "NpcCount (number of guards to spawn)": 10,
          "NpcHealth (health guards spawn with)": 150.0,
          "NpcRadius (max distance guards will roam)": 15.0,
          "NpcAggression (max aggression distance guards will target)": 120.0,
          "MarkerColor (marker color)": "#eddf45",
          "MarkerBorderColor (marker border color)": "#000000",
          "MarkerOpacity (marker opacity)": 0.9,
          "UseLoot (use custom loot table)": true,
          "MaxLootItems (max items to spawn in crate)": 6,
          "CustomLoot (items to spawn in crate)": [{
              "Shortname": "pistol.m92",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "ammo.pistol",
              "MinAmount": 64,
              "MaxAmount": 64
            },
            {
              "Shortname": "pistol.python",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "smg.thompson",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "weapon.mod.flashlight",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "burlap.gloves",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "roadsign.jacket",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "roadsign.kilt",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "coffeecan.helmet",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "gunpowder",
              "MinAmount": 500,
              "MaxAmount": 500
            },
            {
              "Shortname": "smg.2",
              "MinAmount": 1,
              "MaxAmount": 1
            },
            {
              "Shortname": "metal.refined",
              "MinAmount": 50,
              "MaxAmount": 50
            },
            {
              "Shortname": "metal.fragments",
              "MinAmount": 1000,
              "MaxAmount": 1000
            },
            {
              "Shortname": "roadsign.gloves",
              "MinAmount": 1,
              "MaxAmount": 1
            ]
          },
          {
            "EventDuration (duration the event will be active for)": 1800.0,
            "EventName (event name)": "Hard Level",
            "AutoHack (enables auto hacking of crates when an event is finished)": true,
            "AutoHackSeconds (countdown for crate to unlock in seconds)": 60.0,
            "UseKits (use custom kits plugin)": false,
            "Kits (custom kits)": [],
            "NpcName (custom name)": "Hard Guard",
            "NpcCount (number of guards to spawn)": 15,
            "NpcHealth (health guards spawn with)": 200.0,
            "NpcRadius (max distance guards will roam)": 50.0,
            "NpcAggression (max aggression distance guards will target)": 150.0,
            "MarkerColor (marker color)": "#3060d9",
            "MarkerBorderColor (marker border color)": "#000000",
            "MarkerOpacity (marker opacity)": 0.9,
            "UseLoot (use custom loot table)": true,
            "MaxLootItems (max items to spawn in crate)": 6,
            "CustomLoot (items to spawn in crate)": [{
                "Shortname": "ammo.shotgun.fire",
                "MinAmount": 32,
                "MaxAmount": 32
              },
              {
                "Shortname": "ammo.pistol",
                "MinAmount": 96,
                "MaxAmount": 96
              },
              {
                "Shortname": "rifle.semiauto",
                "MinAmount": 1,
                "MaxAmount": 1
              },
              {
                "Shortname": "ammo.rifle",
                "MinAmount": 64,
                "MaxAmount": 64
              },
              {
                "Shortname": "weapon.mod.muzzleboost",
                "MinAmount": 1,
                "MaxAmount": 1
              },
              {
                "Shortname": "weapon.mod.muzzlebrake",
                "MinAmount": 1,
                "MaxAmount": 1
              },
              {
                "Shortname": "smg.mp5",
                "MinAmount": 1,
                "MaxAmount": 1
              },
              {
                "Shortname": "rifle.m39",
                "MinAmount": 1,
                "MaxAmount": 1
              },
              {
                "Shortname": "shotgun.spas12",
                "MinAmount": 1,
                "MaxAmount": 1
              },
              {
                "Shortname": "gunpowder",
                "MinAmount": 750,
                "MaxAmount": 750
              },
              {
                "Shortname": "metal.refined",
                "MinAmount": 75,
                "MaxAmount": 75
              },
              {
                "Shortname": "metal.fragments",
                "MinAmount": 1500,
                "MaxAmount": 1500
              },
              {
                "Shortname": "weapon.mod.lasersight",
                "MinAmount": 1,
                "MaxAmount": 1
              ]
            },
            {
              "EventDuration (duration the event will be active for)": 1800.0,
              "EventName (event name)": "Elite Level",
              "AutoHack (enables auto hacking of crates when an event is finished)": true,
              "AutoHackSeconds (countdown for crate to unlock in seconds)": 60.0,
              "UseKits (use custom kits plugin)": false,
              "Kits (custom kits)": [],
              "NpcName (custom name)": "Elite Noob Guard",
              "NpcCount (number of guards to spawn)": 20,
              "NpcHealth (health guards spawn with)": 350.0,
              "NpcRadius (max distance guards will roam)": 50.0,
              "NpcAggression (max aggression distance guards will target)": 180.0,
              "MarkerColor (marker color)": "#e81728",
              "MarkerBorderColor (marker border color)": "#000000",
              "MarkerOpacity (marker opacity)": 0.9,
              "UseLoot (use custom loot table)": true,
              "MaxLootItems (max items to spawn in crate)": 6,
              "CustomLoot (items to spawn in crate)": [{
                  "Shortname": "rifle.ak",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "ammo.rifle",
                  "MinAmount": 128,
                  "MaxAmount": 128
                },
                {
                  "Shortname": "rifle.l96",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "rifle.lr300",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "lmg.m249",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "rifle.bolt",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "weapon.mod.small.scope",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "metal.facemask",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "metal.plate.torso",
                  "MinAmount": 1,
                  "MaxAmount": 1
                },
                {
                  "Shortname": "gunpowder",
                  "MinAmount": 1000,
                  "MaxAmount": 1000
                },
                {
                  "Shortname": "metal.refined",
                  "MinAmount": 100,
                  "MaxAmount": 100
                },
                {
                  "Shortname": "metal.fragments",
                  "MinAmount": 2000,
                  "MaxAmount": 2000
                },
                {
                  "Shortname": "tactical.gloves",
                  "MinAmount": 1,
                  "MaxAmount": 1
                }
              ]
            }
          ]
        }

Always check edited json files with a json validator
this error (so far) shows when checking it. another thing is always edit data files with the plugin unloaded or it wont save and will revert back to previous version.

Error: Parse error on line 82:
..."MaxAmount": 1
]
},
{ ----------------------^ Expecting '}', ',', got ']'

Alright so i did find a json validator on a website and indeed the json wasnt valid. I found what was the mistake it was actually missing some embrace. Thank you Wulf and pookins for that help!

Reidfira

Alright so i did find a json validator on a website and indeed the json wasnt valid. I found what was the mistake it was actually missing some embrace. Thank you Wulf and pookins for that help!

glad you got it fixed, could  you mark the thread as solved in the status bar

Locked automatically