winstxnhdw / lc-hax

A powerful, feature-rich and highly performant internal cheat for the co-op indie horror video game, Lethal Company.
78 stars 25 forks source link

Issues with nameinweight mod i added manually. #284

Closed joep26020 closed 5 months ago

joep26020 commented 5 months ago

What happened?

Heres the log:

Already up to date. MSBuild version 17.8.3+195e7f5a3 for .NET Determining projects to restore... Restored C:\Users\kaide\lc-hax\lc-hax\lc-hax.csproj (in 298 ms). C:\Users\kaide\lc-hax\lc-hax\Scripts\Modules\NameInWeightMod.cs(10,35): error CS1061: 'Camera' does not contain a defin ition for 'IsNotNull' and no accessible extension method 'IsNotNull' accepting a first argument of type 'Camera' could be found (are you missing a using directive or an assembly reference?) [C:\Users\kaide\lc-hax\lc-hax\lc-hax.csproj] C:\Users\kaide\lc-hax\lc-hax\Scripts\Modules\NameInWeightMod.cs(11,32): error CS1061: 'HUDManager' does not contain a d efinition for 'IsNotNull' and no accessible extension method 'IsNotNull' accepting a first argument of type 'HUDManager ' could be found (are you missing a using directive or an assembly reference?) [C:\Users\kaide\lc-hax\lc-hax\lc-hax.csp roj] C:\Users\kaide\lc-hax\lc-hax\Scripts\Modules\NameInWeightMod.cs(12,39): error CS1061: 'TextMeshProUGUI' does not contai n a definition for 'IsNotNull' and no accessible extension method 'IsNotNull' accepting a first argument of type 'TextM eshProUGUI' could be found (are you missing a using directive or an assembly reference?) [C:\Users\kaide\lc-hax\lc-hax\ lc-hax.csproj] C:\Users\kaide\lc-hax\lc-hax\Scripts\Modules\NameInWeightMod.cs(10,14): warning CS8602: Dereference of a possibly null reference. [C:\Users\kaide\lc-hax\lc-hax\lc-hax.csproj] C:\Users\kaide\lc-hax\lc-hax\Scripts\Modules\NameInWeightMod.cs(11,14): warning CS8602: Dereference of a possibly null reference. [C:\Users\kaide\lc-hax\lc-hax\lc-hax.csproj]

Build FAILED.

C:\Users\kaide\lc-hax\lc-hax\Scripts\Modules\NameInWeightMod.cs(10,14): warning CS8602: Dereference of a possibly null reference. [C:\Users\kaide\lc-hax\lc-hax\lc-hax.csproj] C:\Users\kaide\lc-hax\lc-hax\Scripts\Modules\NameInWeightMod.cs(11,14): warning CS8602: Dereference of a possibly null reference. [C:\Users\kaide\lc-hax\lc-hax\lc-hax.csproj] C:\Users\kaide\lc-hax\lc-hax\Scripts\Modules\NameInWeightMod.cs(10,35): error CS1061: 'Camera' does not contain a defin ition for 'IsNotNull' and no accessible extension method 'IsNotNull' accepting a first argument of type 'Camera' could be found (are you missing a using directive or an assembly reference?) [C:\Users\kaide\lc-hax\lc-hax\lc-hax.csproj] C:\Users\kaide\lc-hax\lc-hax\Scripts\Modules\NameInWeightMod.cs(11,32): error CS1061: 'HUDManager' does not contain a d efinition for 'IsNotNull' and no accessible extension method 'IsNotNull' accepting a first argument of type 'HUDManager ' could be found (are you missing a using directive or an assembly reference?) [C:\Users\kaide\lc-hax\lc-hax\lc-hax.csp roj] C:\Users\kaide\lc-hax\lc-hax\Scripts\Modules\NameInWeightMod.cs(12,39): error CS1061: 'TextMeshProUGUI' does not contai n a definition for 'IsNotNull' and no accessible extension method 'IsNotNull' accepting a first argument of type 'TextM eshProUGUI' could be found (are you missing a using directive or an assembly reference?) [C:\Users\kaide\lc-hax\lc-hax\ lc-hax.csproj] 2 Warning(s) 3 Error(s)

Time Elapsed 00:00:01.30 Unhandled exception: System.IO.FileNotFoundException: Could not find file 'C:\Users\kaide\lc-hax\bin\lc-hax.dll'. File name: 'C:\Users\kaide\lc-hax\bin\lc-hax.dll' at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode) at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize) at System.IO.File.ReadAllBytes(String path) at Program.<<Main>$>g__Inject|0_0(String targetProcess, FileInfo assembly, String loaderNamespace, String loaderClass, String loaderMethod) at System.CommandLine.Handler.<>c__DisplayClass6_05.b0(InvocationContext context) at System.CommandLine.Invocation.AnonymousCommandHandler.Invoke(InvocationContext context) at System.CommandLine.Invocation.InvocationPipeline.<>cDisplayClass4_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass17_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass12_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass22_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass19_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b18_0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass16_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b5_0>d.MoveNext() --- End of stack trace from previous location --- at System.CommandLine.Builder.CommandLineBuilderExtensions.<>cDisplayClass8_0.<b__0>d.MoveNext()

Current Commit Hash

newestbuild

Injector

If you selected "Others" above, please specify the injector you are using.

No response

Log output

No response

Acknowledgement

winstxnhdw commented 5 months ago
using UnityEngine;
using GameNetcodeStuff;
using TMPro;
using Hax;

public sealed class NameInWeightMod : MonoBehaviour {
    RaycastHit[] RaycastHits { get; set; } = new RaycastHit[50];

    void SetWeightCounterText() {
        if (Helper.CurrentCamera is not Camera camera) return;
        if (Helper.HUDManager?.weightCounter is not TextMeshProUGUI weightCounter) return;

        foreach (int i in this.RaycastHits.SphereCastForward(camera.transform).Range()) {
            if (!this.RaycastHits[i].collider.TryGetComponent(out PlayerControllerB player)) {
                continue;
            }

            weightCounter.enableWordWrapping = false;
            weightCounter.text = $"#{player.playerClientId} {player.playerUsername}";
            break;
        }
    }

    void LateUpdate() {
        this.SetWeightCounterText();
    }
}
joep26020 commented 5 months ago
using UnityEngine;
using GameNetcodeStuff;
using TMPro;
using Hax;

public sealed class NameInWeightMod : MonoBehaviour {
    RaycastHit[] RaycastHits { get; set; } = new RaycastHit[50];

    void SetWeightCounterText() {
        if (Helper.CurrentCamera is not Camera camera) return;
        if (Helper.HUDManager?.weightCounter is not TextMeshProUGUI weightCounter) return;

        foreach (int i in this.RaycastHits.SphereCastForward(camera.transform).Range()) {
            if (!this.RaycastHits[i].collider.TryGetComponent(out PlayerControllerB player)) {
                continue;
            }

            weightCounter.enableWordWrapping = false;
            weightCounter.text = $"#{player.playerClientId} {player.playerUsername}";
            break;
        }
    }

    void LateUpdate() {
        this.SetWeightCounterText();
    }
}

thank you!