NockyCZ / CS2-Discord-Utilities

Plugin for communication between your CS2 server and your Discord server
https://buymeacoffee.com/sourcefactory
41 stars 18 forks source link

Report/Call admin #27

Closed L3sh44 closed 2 months ago

L3sh44 commented 2 months ago

After sending the report I get an error and the plugin catches any message and writes Insufficient length of reason

03:56:29 [EROR] (cssharp:Core) Error invoking callback System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list. at System.Text.ValueStringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ReadOnlySpan1 args) at System.String.FormatHelper(IFormatProvider provider, String format, ReadOnlySpan1 args) at System.String.Format(String format, Object[] args) at CounterStrikeSharp.API.Core.Translations.JsonStringLocalizer.get_Item(String name, Object[] arguments) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Translations/JsonStringLocalizer.cs:line 50 at CounterStrikeSharp.API.Core.Translations.StringLocalizer.get_Item(String name, Object[] arguments) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Translations/StringLocalizer.cs:line 20 at Report.Report.SendReport(CCSPlayerController sender, CCSPlayerController target, String reason) in C:\Users\Mates-PC\Desktop\SourceFactory\Projects\CSharp\Discord Utilities\Addons\DU_Report\Report.cs:line 200 at Report.Report.OnPlayerSay(CCSPlayerController player, CommandInfo info) in C:\Users\Mates-PC\Desktop\SourceFactory\Projects\CSharp\Discord Utilities\Addons\DU_Report\Report.cs:line 109 at CounterStrikeSharp.API.Core.BasePlugin.<>cDisplayClass48_0.b__0(Int32 i, IntPtr ptr) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/BasePlugin.cs:line 216 at InvokeStub_Func3.Invoke(Object, Span1) at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) --- End of inner exception stack trace --- at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Delegate.DynamicInvokeImpl(Object[] args) at CounterStrikeSharp.API.Core.FunctionReference.b18_0(fxScriptContext* context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 100

NockyCZ commented 2 months ago

@L3sh44 In the lang file, update "Chat.ReportSend": to "Player {green}{0}{default} has been reported! (Reason: {darkred}{1}{default})",

I accidentally uploaded a version with a bad lang file

L3sh44 commented 2 months ago

@L3sh44 In the lang file, update "Chat.ReportSend": to "Player {green}{0}{default} has been reported! (Reason: {darkred}{1}{default})",

I accidentally uploaded a version with a bad lang file

Thx, i will try it ☺️