Quake1011 / Weapon-Restrict

Weapon restrict CS2 plugin
26 stars 4 forks source link

BUG #5

Open chycken opened 11 months ago

chycken commented 11 months ago

Hello, using cssharp 107, and got this error:

22:40:26 [EROR] (cssharp:Core) Error invoking callback System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null. (Parameter 'key') at System.Collections.Generic.Dictionary2.FindValue(TKey key) at System.Collections.Generic.Dictionary2.TryGetValue(TKey key, TValue& value) at CounterStrikeSharp.API.Modules.Admin.AdminManager.PlayerHasPermissions(CCSPlayerController player, String[] flags) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Admin/AdminPermissions.cs:line 105 at Weapon_Restrict.WeaponRestrict.IsAdmin(CCSPlayerController player) in E:\SteamLibrary\steamapps\common\Counter-Strike Global Offensive\game\csgo\addons\counterstrikesharp\plugins\Weapon_Restrict\Weapon_Restrict.cs:line 438 at Weapon_Restrict.WeaponRestrict.OnEventItemPickupPost(EventItemPickup event, GameEventInfo info) in E:\SteamLibrary\steamapps\common\Counter-Strike Global Offensive\game\csgo\addons\counterstrikesharp\plugins\Weapon_Restrict\Weapon_Restrict.cs:line 89 at InvokeStub_GameEventHandler`1.Invoke(Object, Object, IntPtr) at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr args, BindingFlags invokeAttr) --- End of inner exception stack trace --- at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr args, BindingFlags invokeAttr) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Delegate.DynamicInvokeImpl(Object[] args) at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 82

Plugin working well, maybe you should update it for newest cssharp?

Quake1011 commented 11 months ago

Hello, using cssharp 107, and got this error:

22:40:26 [EROR] (cssharp:Core) Error invoking callback System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null. (Parameter 'key') at System.Collections.Generic.Dictionary2.FindValue(TKey key) at System.Collections.Generic.Dictionary2.TryGetValue(TKey key, TValue& value) at CounterStrikeSharp.API.Modules.Admin.AdminManager.PlayerHasPermissions(CCSPlayerController player, String[] flags) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Modules/Admin/AdminPermissions.cs:line 105 at Weapon_Restrict.WeaponRestrict.IsAdmin(CCSPlayerController player) in E:\SteamLibrary\steamapps\common\Counter-Strike Global Offensive\game\csgo\addons\counterstrikesharp\plugins\Weapon_Restrict\Weapon_Restrict.cs:line 438 at Weapon_Restrict.WeaponRestrict.OnEventItemPickupPost(EventItemPickup event, GameEventInfo info) in E:\SteamLibrary\steamapps\common\Counter-Strike Global Offensive\game\csgo\addons\counterstrikesharp\plugins\Weapon_Restrict\Weapon_Restrict.cs:line 89 at InvokeStub_GameEventHandler`1.Invoke(Object, Object, IntPtr) at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr args, BindingFlags invokeAttr) --- End of inner exception stack trace --- at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr args, BindingFlags invokeAttr) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Delegate.DynamicInvokeImpl(Object[] args) at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass3_0.<.ctor>b__0(fxScriptContext context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 82

Plugin working well, maybe you should update it for newest cssharp?

try latest and let me know about existing issue

chycken commented 11 months ago

its not working. Plugin is running, cant see any error, but i can buy for example awp in 2v2.. this is my restrict config: [ { "Weapon": "weapon_awp", "PlayersInTeamQuota": { "CT": [ { "3": 1, "6": 2, "8": 3 } ], "T": [ { "3": 1, "6": 2, "8": 3 } ] }, "PlayersAllQuota": { "3": 1, "6": 2, "8": 3 } }, { "Weapon": "weapon_scar20", "PlayersInTeamQuota": { "CT": [ { "4": 0, "8": 0, "16": 0 } ], "T": [ { "4": 0, "8": 0, "16": 0 } ] }, "PlayersAllQuota": { "4": 0, "8": 0, "16": 0 } }, { "Weapon": "weapon_m249", "PlayersInTeamQuota": { "CT": [ { "5": 1, "8": 2, "10": 2 } ], "T": [ { "5": 1, "8": 2, "10": 2 } ] }, "PlayersAllQuota": { "4": 0, "6": 0, "8": 0 } }, { "Weapon": "weapon_negev", "PlayersInTeamQuota": { "CT": [ { "5": 1, "8": 2, "10": 2 } ], "T": [ { "5": 1, "8": 2, "10": 2 } ] }, "PlayersAllQuota": { "5": 1, "8": 2, "10": 2 } } ]

chycken commented 11 months ago

and a tip: can u do the plugin a way that config files will be generated in addons/cssharp/configs/plugins folder?

Quake1011 commented 11 months ago

and a tip: can u do the plugin a way that config files will be generated in addons/cssharp/configs/plugins folder?

It was implemented in new version of plugin(now I waiting for CSS update for release this version)

its not working. Plugin is running, cant see any error, but i can buy for example awp in 2v2.. this is my restrict config: [ { "Weapon": "weapon_awp", "PlayersInTeamQuota": { "CT": [ { "3": 1, "6": 2, "8": 3 } ], "T": [ { "3": 1, "6": 2, "8": 3 } ] }, "PlayersAllQuota": { "3": 1, "6": 2, "8": 3 } }, { "Weapon": "weapon_scar20", "PlayersInTeamQuota": { "CT": [ { "4": 0, "8": 0, "16": 0 } ], "T": [ { "4": 0, "8": 0, "16": 0 } ] }, "PlayersAllQuota": { "4": 0, "8": 0, "16": 0 } }, { "Weapon": "weapon_m249", "PlayersInTeamQuota": { "CT": [ { "5": 1, "8": 2, "10": 2 } ], "T": [ { "5": 1, "8": 2, "10": 2 } ] }, "PlayersAllQuota": { "4": 0, "6": 0, "8": 0 } }, { "Weapon": "weapon_negev", "PlayersInTeamQuota": { "CT": [ { "5": 1, "8": 2, "10": 2 } ], "T": [ { "5": 1, "8": 2, "10": 2 } ] }, "PlayersAllQuota": { "5": 1, "8": 2, "10": 2 } } ]

What a config settings u've?

ezekutor commented 11 months ago

это не работает. Плагин запущен, ошибок не видно, но я могу купить, например, awp в режиме 2v2.. это моя конфигурация ограничения: [ { "Weapon": "weapon_awp", "PlayersInTeamQuota": { "CT": [ { "3" : 1, "6": 2, "8": 3 } ], "T": [ { "3": 1, "6": 2, "8": 3 } ] }, "PlayersAllQuota": { " 3": 1, "6": 2, "8": 3 } }, { "Weapon": "weapon_scar20", "PlayersInTeamQuota": { "CT": [ { "4": 0, "8": 0 , "16": 0 } ], "T": [ { "4": 0, "8": 0, "16": 0 } ] }, "PlayersAllQuota": { "4": 0, "8" : 0, "16": 0 } }, { "Weapon": "weapon_m249", "PlayersInTeamQuota": { "CT": [ { "5": 1, "8": 2, "10": 2 } ] , "T": [ { "5": 1, "8": 2, "10": 2 } ] }, "PlayersAllQuota": { "4": 0, "6": 0, "8": 0 } }, { "Weapon": "weapon_negev", "PlayersInTeamQuota": { "CT": [ { "5": 1, "8": 2, "10": 2 } ], "T": [ { " 5": 1, "8": 2, "10": 2 } ] }, "PlayersAllQuota": { "5": 1, "8": 2, "10": 2 } } ]

"AdminImmunityFlag": ""

Quake1011 commented 11 months ago

это не работает. Плагин запущен, ошибок не видно, но я могу купить, например, awp в режиме 2v2.. это моя конфигурация ограничения: [ { "Weapon": "weapon_awp", "PlayersInTeamQuota": { "CT": [ { "3" : 1, "6": 2, "8": 3 } ], "T": [ { "3": 1, "6": 2, "8": 3 } ] }, "PlayersAllQuota": { " 3": 1, "6": 2, "8": 3 } }, { "Weapon": "weapon_scar20", "PlayersInTeamQuota": { "CT": [ { "4": 0, "8": 0 , "16": 0 } ], "T": [ { "4": 0, "8": 0, "16": 0 } ] }, "PlayersAllQuota": { "4": 0, "8" : 0, "16": 0 } }, { "Weapon": "weapon_m249", "PlayersInTeamQuota": { "CT": [ { "5": 1, "8": 2, "10": 2 } ] , "T": [ { "5": 1, "8": 2, "10": 2 } ] }, "PlayersAllQuota": { "4": 0, "6": 0, "8": 0 } }, { "Weapon": "weapon_negev", "PlayersInTeamQuota": { "CT": [ { "5": 1, "8": 2, "10": 2 } ], "T": [ { " 5": 1, "8": 2, "10": 2 } ] }, "PlayersAllQuota": { "5": 1, "8": 2, "10": 2 } } ]

"AdminImmunityFlag": ""

Опишите всю проблему, мне не ясно, что вы хотите

chycken commented 11 months ago

English please

chycken commented 11 months ago

my config settings:

{ "Tag": "{GOLD}[bombateamServer] ", "DestinationTypeRestrictMessage": 1, "DestinationTypeRefundMessage": 1, "RestrictMessageText": "*", "RestrictMessageStatus": true, "RefundMessage": "**", "RefundMessageStatus": true, "RestrictMethod": 1, "AdminImmunityFlag": "" //because i dont want to allow admins to buy restricted weapons

ezekutor commented 11 months ago

это не работает. Плагин запущен, ошибок не видно, но я могу купить, например, awp в режиме 2v2.. это моя конфигурация ограничения: [ { "Weapon": "weapon_awp", "PlayersInTeamQuota": { "CT": [ { "3" : 1, "6": 2, "8": 3 } ], "T": [ { "3": 1, "6": 2, "8": 3 } ] }, "PlayersAllQuota": { " 3": 1, "6": 2, "8": 3 } }, { "Weapon": "weapon_scar20", "PlayersInTeamQuota": { "CT": [ { "4": 0, "8": 0 , "16": 0 } ], "T": [ { "4": 0, "8": 0, "16": 0 } ] }, "PlayersAllQuota": { "4": 0, "8" : 0, "16": 0 } }, { "Weapon": "weapon_m249", "PlayersInTeamQuota": { "CT": [ { "5": 1, "8": 2, "10": 2 } ] , "T": [ { "5": 1, "8": 2, "10": 2 } ] }, "PlayersAllQuota": { "4": 0, "6": 0, "8": 0 } }, { "Weapon": "weapon_negev", "PlayersInTeamQuota": { "CT": [ { "5": 1, "8": 2, "10": 2 } ], "T": [ { " 5": 1, "8": 2, "10": 2 } ] }, "PlayersAllQuota": { "5": 1, "8": 2, "10": 2 } } ]

"AdminImmunityFlag": ""

Опишите всю проблему, мне не ясно, что вы хотите

У меня нет проблем я просто посоветовал флаг убрать, если не убран :)

chycken commented 11 months ago

I did it, but its not restricting anything, with old version it worked

chycken commented 11 months ago

waiting for new update

Quake1011 commented 11 months ago

waiting for new update

quake1011 - add me to discord and i send version for test