Giter Site home page Giter Site logo

karlofduty / customloadouts Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 4.0 7.69 MB

An smod plugin allowing you to set up special sub-classes and giving items based on random chance and user permissions.

Home Page: https://karlofduty.com

License: GNU General Public License v3.0

C# 100.00%
plugin scp-sl smod-plugin smod2

customloadouts's Introduction

KarlofDuty's Github repositories

Hello, you can find my Github repos here. I mainly work on my Discord bots SCPDiscord and SupportBoi nowadays but do tell me if you want any updates for other things too and I'll have a look.

I have also created a lot of the repositories in the @EarthMC organisation but I am no longer active there.

If you are looking for any of my old SCP:SL ServerMod plugins I have transferred them over to the @ServerMod organisation so you can find them there.

customloadouts's People

Contributors

karlofduty avatar laserman367 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

customloadouts's Issues

Changing class with 914

When somebody changes class in the 914, new items are spawned in the person's inventory.
There is some way to prevent that? Other than disabling changing class function..

Bug with giving items

So, I configurated my customloadouts system.

I get the following error:

[ERROR] [karlofduty.CustomLoadouts] System.NullReferenceException: Object reference not set to an instance of an object
at CustomLoadouts.CustomLoadouts.TryGiveItems (Newtonsoft.Json.Linq.JToken currentNode, System.Collections.Generic.IEnumerable`1[T] nodesToCheck, Smod2.API.Player player) [0x00684] in <87056bae736a43219f1e6baf7ad52f12>:0
at CustomLoadouts.ItemGivingHandler+<>c__DisplayClass2_0+<<OnSpawn>b__0>d.MoveNext () [0x00222] in <87056bae736a43219f1e6baf7ad52f12>:0
[ERROR] [karlofduty.CustomLoadouts] System.NullReferenceException: Object reference not set to an instance of an object
at CustomLoadouts.CustomLoadouts.TryGiveItems (Newtonsoft.Json.Linq.JToken currentNode, System.Collections.Generic.IEnumerable`1[T] nodesToCheck, Smod2.API.Player player) [0x00684] in <87056bae736a43219f1e6baf7ad52f12>:0
at CustomLoadouts.ItemGivingHandler+<>c__DisplayClass2_0+<<OnSpawn>b__0>d.MoveNext () [0x00222] in <87056bae736a43219f1e6baf7ad52f12>:0
[ERROR] [karlofduty.CustomLoadouts] System.NullReferenceException: Object reference not set to an instance of an object
at CustomLoadouts.CustomLoadouts.TryGiveItems (Newtonsoft.Json.Linq.JToken currentNode, System.Collections.Generic.IEnumerable`1[T] nodesToCheck, Smod2.API.Player player) [0x00684] in <87056bae736a43219f1e6baf7ad52f12>:0
at CustomLoadouts.ItemGivingHandler+<>c__DisplayClass2_0+<<OnSpawn>b__0>d.MoveNext () [0x00222] in <87056bae736a43219f1e6baf7ad52f12>:0
[ERROR] [karlofduty.CustomLoadouts] System.NullReferenceException: Object reference not set to an instance of an object
at CustomLoadouts.CustomLoadouts.TryGiveItems (Newtonsoft.Json.Linq.JToken currentNode, System.Collections.Generic.IEnumerable`1[T] nodesToCheck, Smod2.API.Player player) [0x00684] in <87056bae736a43219f1e6baf7ad52f12>:0
at CustomLoadouts.ItemGivingHandler+<>c__DisplayClass2_0+<<OnSpawn>b__0>d.MoveNext () [0x00222] in <87056bae736a43219f1e6baf7ad52f12>:0
[ERROR] [karlofduty.CustomLoadouts] System.NullReferenceException: Object reference not set to an instance of an object
at CustomLoadouts.CustomLoadouts.TryGiveItems (Newtonsoft.Json.Linq.JToken currentNode, System.Collections.Generic.IEnumerable`1[T] nodesToCheck, Smod2.API.Player player) [0x00684] in <87056bae736a43219f1e6baf7ad52f12>:0
at CustomLoadouts.ItemGivingHandler+<>c__DisplayClass2_0+<<OnSpawn>b__0>d.MoveNext () [0x00222] in <87056bae736a43219f1e6baf7ad52f12>:0
[ERROR] [karlofduty.CustomLoadouts] System.NullReferenceException: Object reference not set to an instance of an object
at CustomLoadouts.CustomLoadouts.TryGiveItems (Newtonsoft.Json.Linq.JToken currentNode, System.Collections.Generic.IEnumerable`1[T] nodesToCheck, Smod2.API.Player player) [0x00684] in <87056bae736a43219f1e6baf7ad52f12>:0
at CustomLoadouts.ItemGivingHandler+<>c__DisplayClass2_0+<<OnSpawn>b__0>d.MoveNext () [0x00222] in <87056bae736a43219f1e6baf7ad52f12>:0

My config is:

# Prints a confirmation whenever a player is given a loadout
verbose: true
# Prints debug messages
debug: false
# Adds a ms delay if needed for plugin compatibility
delay: 0

# Filters are processed in the order they are written except anything marked as "all" is always processed before all other entries
items:
    # SteamID
    all:
        # Rank, the name of the server rank defined in config_remoteadmin.txt. Set to none for only players without a rank.
        all:
            # Class, check #resources in the SMOD discord server for class names
            SCIENTIST:
                - 10:
                    - REMOVEITEMS
                    - MAJOR_SCIENTIST_KEYCARD
                    - MEDKIT
                - 5:
                    - REMOVEITEMS
                    - REMOVEAMMO
                    - USP
                    - DROPPED_9
                    - DROPPED_9
                    - MAJOR_SCIENTIST_KEYCARD
                    - MEDKIT
            CHAOS_INSURGENCY:
                - 100:
                    - DISARMER
            CLASSD:
                - 25:
                    - MEDKIT
                - 10:
                    - JANITOR_KEYCARD
            NTF_COMMANDER:
                - 0.1:
                    - O5_LEVEL_KEYCARD
                - 100:
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
            FACILITY_GUARD:
                - 100:
                    - DROPPED_7
                    - DROPPED_7
                    - DROPPED_7
                    - DROPPED_7
                - 25:
                    - REMOVEITEMS
                    - SENIOR_GUARD_KEYCARD
                    - P90
                    - DROPPED_9
                    - DROPPED_9
                    - DROPPED_9
                    - DROPPED_9
           NTF_CADET:
                - 100:
                    - DROPPED_9
                    - DROPPED_9
                    - DROPPED_9
                    - DROPPED_9
           NTF_LIEUTENANT:
                - 100:
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5
                    - DROPPED_5

How to config permission

I have 100% chance for coin and i don't get it...

My config:

# Prints a confirmation whenever a player is given a loadout
verbose: true
# Prints debug messages
debug: false
# Adds a ms delay if needed for plugin compatibility
delay: 0

# This sets up the loadouts and the permission nodes required to get them
# For instance "customloadouts.donatorloadouts" gives all loadouts under the donatorloadouts node below, as long as the class and chance checks are successful.
customloadouts:
    sponsorloadouts:
        CLASSD:
            - 100:
                - COIN 
            - 10:
                - MEDKIT
                - FLASHLIGHT
                - RADIO
                - ZONE_MANAGER_KEYCARD
            - 5:
                - COM15_PISTOL
        SCIENTIST:
            - 100:
                - COIN 
            - 10:
                - REMOVEITEMS
                - REMOVEAMMO
                - MEDKIT
                - FLASHLIGHT
                - RADIO
                - ZONE_MANAGER_KEYCARD
            - 5:
                - REMOVEITEMS
                - REMOVEAMMO
                - COM15_PISTOL
                - DROPPED_9
                - DROPPED_9

New feature

Create different configs for different servers

Errors take off in the console

[14:54:22] [ERROR] [karlofduty.CustomLoadouts] Could not load config: YamlDotNet.Core.SemanticErrorException: (Line: 21, Col: 13, Idx: 1227) - (Line: 21, Col: 14, Idx: 1228): While parsing a block mapping, did not find expected key.
at YamlDotNet.Core.Parser.ParseBlockMappingKey (System.Boolean isFirst) [0x000d8] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Core.Parser.StateMachine () [0x000d1] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Core.Parser.MoveNext () [0x0001f] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Core.ParserExtensions.Allow[T] (YamlDotNet.Core.IParser parser) [0x00018] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Core.ParserExtensions.Expect[T] (YamlDotNet.Core.IParser parser) [0x00000] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.NodeDeserializers.CollectionNodeDeserializer.DeserializeHelper (System.Type tItem, YamlDotNet.Core.IParser parser, System.Func3[T1,T2,TResult] nestedObjectDeserializer, System.Collections.IList result, System.Boolean canUpdate) [0x000e2] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0 at YamlDotNet.Serialization.NodeDeserializers.CollectionNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize (YamlDotNet.Core.IParser parser, System.Type expectedType, System.Func3[T1,T2,TResult] nestedObjectDeserializer, System.Object& value) [0x000a6] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue (YamlDotNet.Core.IParser parser, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, YamlDotNet.Serialization.IValueDeserializer nestedObjectDeserializer) [0x00088] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue (YamlDotNet.Core.IParser parser, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, YamlDotNet.Serialization.IValueDeserializer nestedObjectDeserializer) [0x0006e] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer+<>c__DisplayClass3_0.b__0 (YamlDotNet.Core.IParser r, System.Type t) [0x00000] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.DeserializeHelper (System.Type tKey, System.Type tValue, YamlDotNet.Core.IParser parser, System.Func3[T1,T2,TResult] nestedObjectDeserializer, System.Collections.IDictionary result) [0x00041] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0 at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize (YamlDotNet.Core.IParser parser, System.Type expectedType, System.Func3[T1,T2,TResult] nestedObjectDeserializer, System.Object& value) [0x00096] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue (YamlDotNet.Core.IParser parser, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, YamlDotNet.Serialization.IValueDeserializer nestedObjectDeserializer) [0x00088] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue (YamlDotNet.Core.IParser parser, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, YamlDotNet.Serialization.IValueDeserializer nestedObjectDeserializer) [0x0006e] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer+<>c__DisplayClass3_0.b__0 (YamlDotNet.Core.IParser r, System.Type t) [0x00000] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.DeserializeHelper (System.Type tKey, System.Type tValue, YamlDotNet.Core.IParser parser, System.Func3[T1,T2,TResult] nestedObjectDeserializer, System.Collections.IDictionary result) [0x00041] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0 at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize (YamlDotNet.Core.IParser parser, System.Type expectedType, System.Func3[T1,T2,TResult] nestedObjectDeserializer, System.Object& value) [0x00096] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue (YamlDotNet.Core.IParser parser, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, YamlDotNet.Serialization.IValueDeserializer nestedObjectDeserializer) [0x00088] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue (YamlDotNet.Core.IParser parser, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, YamlDotNet.Serialization.IValueDeserializer nestedObjectDeserializer) [0x0006e] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer+<>c__DisplayClass3_0.b__0 (YamlDotNet.Core.IParser r, System.Type t) [0x00000] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.DeserializeHelper (System.Type tKey, System.Type tValue, YamlDotNet.Core.IParser parser, System.Func3[T1,T2,TResult] nestedObjectDeserializer, System.Collections.IDictionary result) [0x00041] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0 at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize (YamlDotNet.Core.IParser parser, System.Type expectedType, System.Func3[T1,T2,TResult] nestedObjectDeserializer, System.Object& value) [0x00096] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue (YamlDotNet.Core.IParser parser, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, YamlDotNet.Serialization.IValueDeserializer nestedObjectDeserializer) [0x00088] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue (YamlDotNet.Core.IParser parser, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, YamlDotNet.Serialization.IValueDeserializer nestedObjectDeserializer) [0x0006e] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer+<>c__DisplayClass3_0.b__0 (YamlDotNet.Core.IParser r, System.Type t) [0x00000] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.DeserializeHelper (System.Type tKey, System.Type tValue, YamlDotNet.Core.IParser parser, System.Func3[T1,T2,TResult] nestedObjectDeserializer, System.Collections.IDictionary result) [0x00041] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0 at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize (YamlDotNet.Core.IParser parser, System.Type expectedType, System.Func3[T1,T2,TResult] nestedObjectDeserializer, System.Object& value) [0x00096] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue (YamlDotNet.Core.IParser parser, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, YamlDotNet.Serialization.IValueDeserializer nestedObjectDeserializer) [0x00088] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue (YamlDotNet.Core.IParser parser, System.Type expectedType, YamlDotNet.Serialization.Utilities.SerializerState state, YamlDotNet.Serialization.IValueDeserializer nestedObjectDeserializer) [0x0006e] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.Deserializer.Deserialize (YamlDotNet.Core.IParser parser, System.Type type) [0x0004e] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.Deserializer.Deserialize (System.IO.TextReader input, System.Type type) [0x00007] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at YamlDotNet.Serialization.Deserializer.Deserialize (System.IO.TextReader input) [0x00000] in <9c4711b2c05a400a8c6dcc83d3e0d0ee>:0
at CustomLoadouts.CustomLoadouts.Reload () [0x00132] in <429983a64c5944a2abc397f7c68a82dc>:0
at CustomLoadouts.CustomLoadouts.OnEnable () [0x00002] in <429983a64c5944a2abc397f7c68a82dc>:0

Plugin is not working.

This plugin does not give out items.
The only error in console: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies.

CONFIG FILE:

verbose: true
debug: true
delay: 0

customloadouts:
    director:
        all:
            - 100:
                - COIN 
                - COIN
                - COIN
                - COIN

P.S. The "Director" role exists on my server

Idea

The chances of adding a given amount of HP.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.