Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
still need the addresses for scr_player_sprinttime and/or player_sprintUnilimited
#21
(03-04-2012, 13:19)zxz0O0 Wrote: Why address? Just do in your plugin
CSHARP Code
  1. SetDvar("perk_sprintMultiplier", "999");

First Code: Add this ^ OnMapChange().

Second code:
Define
Code:
perk_sprintMultiplier_var
as a string (don't convert to int) then do like this OnMapChange()
CSHARP Code
  1. SetDvar("perk_sprintMultiplier", perk_sprintMultiplier_var);
[Image: azuw.jpg]
Reply

#22
(03-05-2012, 07:44)zxz0O0 Wrote:
(03-04-2012, 13:19)zxz0O0 Wrote: Why address? Just do in your plugin
CSHARP Code
  1. SetDvar("perk_sprintMultiplier", "999");

First Code: Add this ^ OnMapChange().

Second code:
Define
Code:
perk_sprintMultiplier_var
as a string (don't convert to int) then do like this OnMapChange()
CSHARP Code
  1. SetDvar("perk_sprintMultiplier", perk_sprintMultiplier_var);

ok, i did.
it didn't work.
to clarify, the plugin changed the dvar in the server.
i checked it.
but it didn't change the sprint duration

source code:

Code:
using System;
using System.Runtime.InteropServices;
using System.Security;
using Addon;

//Compile with /unsafe
//And a reference to "addon/dist/addon.dll"

namespace SprintExtend
{
    public class Program : CPlugin
    {
        [DllImport("kernel32.dll", SetLastError = true)]
        public static extern bool WriteProcessMemory(IntPtr hProcess, int lpBaseAddress, byte[] lpBuffer, int nSize, out int lpNumberOfBytesWritten);

        unsafe public override void OnMapChange()
        {
        ServerPrint("Plugin: SprintExtend by blueberry9 and zxz0O0 loaded.");
  
        SetDvar("perk_sprintMultiplier", "999");
        }
    }
}
[Image: c2ship5_sig.png]
Reply

#23
Of course it doesn't work if you removed now the stuff that changes it Huh

You still need the WriteProcessMemory stuff, I said add not replace

CSHARP Code
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Security;
  4. using Addon;
  5.  
  6. //Compile with /unsafe
  7. //And a reference to "addon/dist/addon.dll"
  8.  
  9. namespace SprintExtend
  10. {
  11. public class Program : CPlugin
  12. {
  13. [DllImport("kernel32.dll", SetLastError = true)]
  14. public static extern bool WriteProcessMemory(IntPtr hProcess, int lpBaseAddress, byte[] lpBuffer, int nSize, out int lpNumberOfBytesWritten);
  15.  
  16. public override void OnMapChange()
  17. {
  18.  
  19. SetDvar("perk_sprintMultiplier", "999");
  20. }
  21. unsafe public override void OnServerLoad()
  22. {
  23. ServerPrint("Plugin: Sprint_Multiplier by blueberry9 and zxz0O0 loaded.");
  24.  
  25. int oP;
  26. byte[] bytes = { 0x90, 0x90 };
  27. WriteProcessMemory(((IntPtr)(-1)), 0x0040C877, bytes, bytes.Length, out oP);
  28. }
  29. }
  30. }


Just FYI: The WriteProcessMemory stuff patches the server so the server thinks everyone has Marathon Perk. If you set dvars it's better to set them OnMapChange(), it's also possible OnServerLoad() but it may crash the server.
[Image: azuw.jpg]
Reply

#24
(03-05-2012, 15:23)zxz0O0 Wrote: Of course it doesn't work if you removed now the stuff that changes it Huh

You still need the WriteProcessMemory stuff, I said add not replace

[code=csharp]using System;
using System.Runtime.InteropServices;
using System.Security;
using Addon;

//Compile with /unsafe
//And a reference to "addon/dist/addon.dll"

namespace SprintExtend
{
public class Program : CPlugin
{
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool WriteProcessMemory(IntPtr hProcess, int lpBaseAddress, byte[] lpBuffer, int nSize, out int lpNumberOfBytesWritten);

public override void OnMapChange()
{

SetDvar("perk_sprintMultiplier", "999");
}
unsafe public override void OnServerLoad()
{
ServerPrint("Plugin: Sprint_Multiplier by blueberry9 and zxz0O0 loaded.");

int oP;
byte[] bytes = { 0x90, 0x90 };
WriteProcessMemory(((IntPtr)(-1)), 0x0040C877, bytes, bytes.Length, out oP);
}
}
}

ok.
doh.
fixing...
that worked.
finally!!! Fuck yea! LOL
Z, i owe you man.
no one else was willing to take the time to help me.
much appreciated!
i owe you man!
[Image: c2ship5_sig.png]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] Zombies Addresses New Patch! barata 1 2,659 12-15-2012, 07:18
Last Post: Stocker
  Finding Addresses Of DVAR's Baber786 3 2,850 06-02-2011, 14:21
Last Post: Baber786

Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.