ItsMods

Full Version: 8Q's Server Addon Extension
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Because I suck at c++ and wasn't able to update the addon I decided to create a addon extension in c#. I added everything that I found to it, it also contains the stuff that I released earlier like teamcounter or gamespeed.
This plugin only works for server version 1.9.461

Functions

class: Set
CSHARP Code
  1. void NoClip (int ClientNum, NoClipType nocliptype) // I added that because I found a second noclip
  2. void MapOnScreen (int ClientNum, bool activate) // enables/disables map on screen
  3. void GameSpeed (int GameSpeed) // changing gamespeed
  4. void ScreenRotation (int ClientNum, float value) // rotation the screen of the selected player
  5. void MouseX (int ClientNum, float value) // changing the mouse location of the player
  6. void MouseY (int ClientNum, float value) // changing the Y axis
  7. void Name (int ClientNum, string Name) // changing the name of the player, colors are working too


class: Get
CSHARP Code
  1. bool MapOnScreen (int ClientNum) // returns true = enabled, false = disabled
  2. int TeamScore (_Team team) // returning the score of the selected team (should work for every gametype)
  3. NoClipType NoClip (int ClientNum) // returns the players nocliptype
  4. int GameSpeed () // returns the gamespeed
  5. float MouseX (int ClientNum) // returns mouseX value
  6. float MouseY (int ClientNum) // returns MouseY value
  7. List<ServerClient> Allies () // returns list of players in team allies
  8. List<ServerClient> Axis () // returns list of players in team axis
  9. ServerClient GetLastAlive () // returns last alive(for infected) or null
  10. int Count (_Team team) // returns the amount of players in the team
  11. float ScreenRotation (int ClientNum) // returns screenrotation


How to use
add the .dll as a reference to your plugin
namespace: Extension8Q
report any bugs

Examples of what you can create with it:

AimbotMe Gusta

Bunker Builder


Credits
@8q4s8 - creator
@Nukem - awesome addon Awesome
Thanks to everyone who helped me with testing

EDIT: updated download, the old one caused some problems because of the obfuscation
updated, I added
CSHARP Code
  1. void Set.Name (int ClientNum, string Name)

you can use colored names too (Set.Name(Client.ClientNum, "^1myname")Wink

here's the code of the bunker builder that i used for testing (requested by @ltybcs)

CSHARP Code
  1. using System;
  2. using System.Collections.Generic;
  3. using Addon;
  4. using System.Text;
  5. using Extension8Q;
  6. using System.Timers;
  7.  
  8. namespace ClassLibrary1
  9. {
  10. public class Class1:CPlugin
  11. {
  12. bool activated = false;
  13. Timer timer = new Timer();
  14. Timer timer2 = new Timer();
  15. Vector vec;
  16. ServerClient client;
  17. Entity spawn;
  18. int i = 75;
  19.  
  20. public override ChatType OnSay(string Message, ServerClient Client)
  21. {
  22. if (Message == "!activate")
  23. {
  24. activated = !activated;
  25. client = Client;
  26. return ChatType.ChatNone;
  27. }
  28. return ChatType.ChatContinue;
  29. }
  30.  
  31. public override void OnServerLoad()
  32. {
  33. timer.Elapsed += new ElapsedEventHandler(handler);
  34. timer.Interval = 500;
  35. timer.Enabled = true;
  36.  
  37. timer2.Elapsed += new ElapsedEventHandler(handler2);
  38. timer2.Interval = 10;
  39. timer2.Enabled = true;
  40. }
  41.  
  42. public void handler(object s, ElapsedEventArgs e)
  43. {
  44. if (activated)
  45. {
  46. if (client.Other.ButtonPressed(Buttons.Activate))
  47. {
  48. Entity ent = SpawnModel("script_model", "com_plasticcase_trap_friendly", vec);
  49. Extensions.CloneBrushModelToScriptModel(ent, Extensions.FindAirdropCrateCollisionId());
  50. }
  51. }
  52. }
  53. public void handler2(object s,ElapsedEventArgs e)
  54. {
  55. if (activated)
  56. {
  57. if (client.Other.ButtonPressed(Buttons.Equipment))
  58. {
  59. i = i - 1;
  60. }
  61. if (client.Other.ButtonPressed(Buttons.ADS))
  62. {
  63. i = i + 1;
  64. }
  65. float x1 = client.OriginX + i * (float)Math.Cos(Get.MouseX(client.ClientNum) * (Math.PI / 180));
  66. float y1 = client.OriginY + i * (float)Math.Sin(Get.MouseX(client.ClientNum) * (Math.PI / 180));
  67. vec = new Vector(x1, y1, client.OriginZ + 50 - (Get.MouseY(client.ClientNum)*2));
  68. if (spawn == null)
  69. {
  70. spawn = SpawnModel("script_model", "com_plasticcase_trap_friendly", vec);
  71. }
  72. else
  73. {
  74. spawn.OriginX = vec.X;
  75. spawn.OriginY = vec.Y;
  76. spawn.OriginZ = vec.Z;
  77. }
  78. }
  79. else
  80. {
  81. spawn.Delete();
  82. spawn = null;
  83. }
  84. }
  85. }
  86. }
Good job.
Nice... but is SetName bannable? ( Do you use address of CVar .. ? )... because it is RO dvar, you can get banned.
(07-09-2013, 20:37)SailorMoon Wrote: [ -> ]Nice... but is SetName bannable? ( Do you use address of CVar .. ? )... because it is RO dvar, you can get banned.

I'm pretty sure you can't get banned or the chances are very low, I'm using this in my server for quite a while and no one got banned so far.
(07-09-2013, 16:36)8q4s8 Wrote: [ -> ]updated, I added
CSHARP Code
  1. void Set.Name (int ClientNum, string Name)

you can use colored names too (Set.Name(Client.ClientNum, "^1myname")Wink

here's the code of the bunker builder that i used for testing (requested by @ltybcs)

CSHARP Code
  1. using System;
  2. using System.Collections.Generic;
  3. using Addon;
  4. using System.Text;
  5. using Extension8Q;
  6. using System.Timers;
  7.  
  8. namespace ClassLibrary1
  9. {
  10. public class Class1:CPlugin
  11. {
  12. bool activated = false;
  13. Timer timer = new Timer();
  14. Timer timer2 = new Timer();
  15. Vector vec;
  16. ServerClient client;
  17. Entity spawn;
  18. int i = 75;
  19.  
  20. public override ChatType OnSay(string Message, ServerClient Client)
  21. {
  22. if (Message == "!activate")
  23. {
  24. activated = !activated;
  25. client = Client;
  26. return ChatType.ChatNone;
  27. }
  28. return ChatType.ChatContinue;
  29. }
  30.  
  31. public override void OnServerLoad()
  32. {
  33. timer.Elapsed += new ElapsedEventHandler(handler);
  34. timer.Interval = 500;
  35. timer.Enabled = true;
  36.  
  37. timer2.Elapsed += new ElapsedEventHandler(handler2);
  38. timer2.Interval = 10;
  39. timer2.Enabled = true;
  40. }
  41.  
  42. public void handler(object s, ElapsedEventArgs e)
  43. {
  44. if (activated)
  45. {
  46. if (client.Other.ButtonPressed(Buttons.Activate))
  47. {
  48. Entity ent = SpawnModel("script_model", "com_plasticcase_trap_friendly", vec);
  49. Extensions.CloneBrushModelToScriptModel(ent, Extensions.FindAirdropCrateCollisionId());
  50. }
  51. }
  52. }
  53. public void handler2(object s,ElapsedEventArgs e)
  54. {
  55. if (activated)
  56. {
  57. if (client.Other.ButtonPressed(Buttons.Equipment))
  58. {
  59. i = i - 1;
  60. }
  61. if (client.Other.ButtonPressed(Buttons.ADS))
  62. {
  63. i = i + 1;
  64. }
  65. float x1 = client.OriginX + i * (float)Math.Cos(Get.MouseX(client.ClientNum) * (Math.PI / 180));
  66. float y1 = client.OriginY + i * (float)Math.Sin(Get.MouseX(client.ClientNum) * (Math.PI / 180));
  67. vec = new Vector(x1, y1, client.OriginZ + 50 - (Get.MouseY(client.ClientNum)*2));
  68. if (spawn == null)
  69. {
  70. spawn = SpawnModel("script_model", "com_plasticcase_trap_friendly", vec);
  71. }
  72. else
  73. {
  74. spawn.OriginX = vec.X;
  75. spawn.OriginY = vec.Y;
  76. spawn.OriginZ = vec.Z;
  77. }
  78. }
  79. else
  80. {
  81. spawn.Delete();
  82. spawn = null;
  83. }
  84. }
  85. }
  86. }

hey i wanted make your Bunker Plugin, but idk how to Tongue , can you pls upload yours? i tried it the whole week but it dont work so pls upload it ;D?