ItsMods

Full Version: Gamespeed plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey
I created another small plugin, it isn't very useful but maybe someone can use it for something.

commands:
Code:
!gamespeed - shows the current gamespeed
!gamespeed <number> - changing the gamespeed
gamespeed > 5000 can crash your server

It's really funny to play around with it and to troll the people in the server Troll




CSHARP Code
  1. using System;
  2. using System.Collections.Generic;
  3. using Addon;
  4. using System.Text;
  5.  
  6. namespace ClassLibrary1
  7. {
  8. public class Class1:CPlugin
  9. {
  10. IntPtr gamespeed;
  11.  
  12. public override void OnServerLoad()
  13. {
  14. gamespeed = (IntPtr)Convert.ToInt32(0x0587EA14);
  15. ServerPrint("GameSpeed Plugin by 8Q4S8 loaded!");
  16. }
  17. unsafe public override ChatType OnSay(string Message, ServerClient Client)
  18. {
  19. if (Message.ToLower().StartsWith("!gamespeed"))
  20. {
  21. string[] split = Message.Split(' ');
  22.  
  23. if (split.Length == 1)
  24. {
  25. ServerSay("Gamespeed: "+*(int*)gamespeed, true);
  26. return ChatType.ChatNone;
  27. }
  28.  
  29. *(int*)gamespeed = Convert.ToInt32(split[1]);
  30. ServerSay("Gamespeed changed to " + *(int*)gamespeed, true);
  31. return ChatType.ChatNone;
  32. }
  33. return ChatType.ChatContinue;
  34. }
  35. public override unsafe void OnMapChange()
  36. {
  37. *(int*)gamespeed = 0;
  38. }
  39. }
  40. }


Gamespeed reset to 0 in OnMapChange is necessary to avoid crashes.

Enjoy!
wooow! Look the time its going crazy :p

BTW nice plugin ^^
This looks like timescale, is it?
tkn you
How do you find the adresses ?
Do you use timescale ?
By the way, it can crash server. ( not just 5000, like random moments ) (in mw2/cod4 it was crashing)
It isn't timescale, it isn't a float value as you can see but it's near timescale in memory.
Timescale address: 0587E9C8