Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Waypoint plugin for users
#1
It looks like zoomby leeched the addresses that I posted in the help section and asked zxz to make a plugin for him. but nvm, I will release the plugin that I made myself with a config option so everyone can use it.

sv_config
Code:
[POINTS]
points=2
//point123,mapname,X,Y,iconNumber
point1=mp_village,-1043,549,211
point2=mp_bootleg,-96,-44,211

only one point per map is possible.

You can obviously use the source code for other stuff too

use the !icon command to find a nice icon Wink
example: !icon 123

source code:
CSHARP Code
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Addon;
  5.  
  6. namespace Point
  7. {
  8. public class VecXY
  9. {
  10. public float xVec;
  11. public float yVec;
  12. public int Icon;
  13.  
  14. public VecXY(float x,float y, int icon)
  15. {
  16. xVec = x;
  17. yVec = y;
  18. Icon = icon;
  19. }
  20. }
  21. public class Class1 : CPlugin
  22. {
  23.  
  24. IntPtr activate, icon,X,Y;
  25.  
  26. int iconNum;
  27. float x;
  28. float y;
  29.  
  30. Dictionary<string, VecXY> maps = new Dictionary<string, VecXY>();
  31.  
  32.  
  33. public override void OnServerLoad()
  34. {
  35. activate = (IntPtr)Convert.ToInt32(0x01B1EE9C);
  36. icon = (IntPtr)Convert.ToInt32(0x01B1EEBC);
  37. X = (IntPtr)Convert.ToInt32(0x01B1EEA0);
  38. Y = (IntPtr)Convert.ToInt32(0x01B1EEA4);
  39.  
  40. Config();
  41. }
  42.  
  43. public override void OnMapChange()
  44. {
  45. string map = GetDvar("mapname");
  46.  
  47. foreach (string key in maps.Keys)
  48. {
  49. if (key.Contains(map))
  50. {
  51. x = maps[key].xVec;
  52. y = maps[key].yVec;
  53. iconNum = maps[key].Icon;
  54.  
  55. Activate();
  56. ChangeIcon();
  57. SetPosition();
  58. }
  59. }
  60. }
  61.  
  62. void Config()
  63. {
  64. try
  65. {
  66. string points = GetServerCFG("POINTS", "points", "");
  67. if (points != "0")
  68. {
  69. for (int i = 1; i <= int.Parse(points); i++)
  70. {
  71. string loc = GetServerCFG("POINTS", string.Format("point{0}", i), "");
  72. if (loc != null)
  73. {
  74. string _mp = loc.Split(',')[0];
  75. string _x = loc.Split(',')[1];
  76. string _y = loc.Split(',')[2];
  77. string _icon = loc.Split(',')[3];
  78.  
  79. maps.Add(_mp, new VecXY(float.Parse(_x), float.Parse(_y), int.Parse(_icon)));
  80. }
  81. }
  82. }
  83. }
  84. catch (Exception ex) { ServerPrint("Loading points failed: " + ex.Message); }
  85. }
  86.  
  87. #region ----
  88. unsafe public void Activate()
  89. {
  90. *(int*)activate = 1;
  91. }
  92. unsafe public void ChangeIcon()
  93. {
  94.  
  95. *(int*)icon = iconNum;
  96. }
  97. unsafe public void Deactivate()
  98. {
  99.  
  100. *(int*)activate = 0;
  101. }
  102. unsafe public void SetPosition()
  103. {
  104.  
  105. *(float*)X = x;
  106. *(float*)Y = y;
  107.  
  108. }
  109. #endregion
  110.  
  111. public override unsafe ChatType OnSay(string Message, ServerClient Client)
  112. {
  113. if (Message.StartsWith("!icon"))
  114. {
  115. string[] split = Message.Split(' ');
  116.  
  117. iconNum = int.Parse(split[1]);
  118.  
  119. Activate();
  120. ChangeIcon();
  121.  
  122. return ChatType.ChatNone;
  123. }
  124. return ChatType.ChatContinue;
  125. }
  126. }
  127. }


Attached Files
.zip   Waypoint.zip (Size: 3.02 KB / Downloads: 83)
Reply

#2
Nice release, Could be possible to have more than one for each map, will be cool if you can point all the flags in the minimap. Thanks for asnwering
Reply

#3
I already searched for something like that but it looks like only one is possible
Reply

#4
great job! but I found the address in memory and used them to OnAddonFrame, my server is SRASHED when I'm connected to it! Could you give a lesson in it's mods.com how to save and use the bytes in mw3 server addon? Thank you.
p.s i am used CI
[Image: 6iiLEmPSEm0.jpg]
skype egor2398los
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 4,161 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,744 11-08-2013, 19:13
Last Post: clemi555
  [Release] Bunker Plugin 1.3 archit 68 41,498 10-30-2013, 11:59
Last Post: clacki
  Help Modifying plugin maverigh 5 5,666 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 5,176 10-19-2013, 06:59
Last Post: iRoNinja
  [Release] Yurio Map Plugin Yurio 101 62,186 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 18,619 09-23-2013, 13:18
Last Post: SgtLegend
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 2,710 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,256 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  Search Plugin Fluid Killcam N3xT_974 1 3,063 09-10-2013, 20:27
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
1 Guest(s)

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