private void ChangeModel() { if (Addresses.PlayerModel == IntPtr.Zero) { AppendLog("An error ocurred. Maybe you aren't in-game.", Color.IndianRed); return; } if (Enum.IsDefined(typeof(Enums.Characters), MemoryReader.GetPlayerModel())) { AppendLog("Please wait til your model loads.", Color.IndianRed); return; } _ModelChanged = !_ModelChanged; try { if (_ModelChanged) { MemoryReader.mem.Write(Addresses.PlayerModel, ACRatModel); AppendLog("Now you'll crash players if you jump near them.", Color.Orange); } else { MemoryReader.mem.Write(Addresses.PlayerModel, CurrentModel); AppendLog("Crasher disabled. Back to player model.", Color.CadetBlue); } } catch (Exception) { AppendLog("Sorry, an error ocurred.", Color.IndianRed); } }
//50ms private async void On_Tick(object sender, EventArgs e) { System.Diagnostics.Process p = Utilities.BaseProc(); if (mutateBtn.Enabled && Keyboard.IsKeyDown(Keys.Insert) && p != null) { AntiFlood(); ChangeModel(); } if (p != null && !_HOOKED) { _HOOKED = !_HOOKED; Addresses.WorldPtr = IntPtr.Zero; Addresses.LocalPlayer = IntPtr.Zero; Addresses.PlayerModel = IntPtr.Zero; int _processid = p.Id; AppendLog($"FiveM Found! PID: {_processid}", Color.Green); //game instanced? while (Addresses.WorldPtr == IntPtr.Zero) { try { await Task.Run(MemoryReader.GetWorldPtr); AppendLog($"WorldPTR => 0x{Utilities.ToHex(Addresses.WorldPtr)}", Color.Olive); mutateBtn.Enabled = true; } catch (Exception) { } await Task.Delay(5000); } } if (p == null && _HOOKED) { _HOOKED = !_HOOKED; mutateBtn.Enabled = false; AppendLog("Looking for FiveM Process...", Color.BlueViolet); } if (_HOOKED) { try { currModel.Text = MemoryReader.GetPlayerModel().ToString(); } catch (Exception) { currModel.Text = "None"; } } }