05-16-2013, 13:10
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
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
example: !icon 123
source code:
sv_config
Code:
[POINTS]
points=2
//point123,mapname,X,Y,iconNumber
point1=mp_village,-1043,549,211
point2=mp_bootleg,-96,-44,211only 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

example: !icon 123
source code:
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Addon;
namespace Point
{
public class VecXY
{
public float xVec;
public float yVec;
public int Icon;
public VecXY(float x,float y, int icon)
{
xVec = x;
yVec = y;
Icon = icon;
}
}
public class Class1 : CPlugin
{
IntPtr activate, icon,X,Y;
int iconNum;
float x;
float y;
Dictionary<string, VecXY> maps = new Dictionary<string, VecXY>();
public override void OnServerLoad()
{
activate = (IntPtr)Convert.ToInt32(0x01B1EE9C);
icon = (IntPtr)Convert.ToInt32(0x01B1EEBC);
X = (IntPtr)Convert.ToInt32(0x01B1EEA0);
Y = (IntPtr)Convert.ToInt32(0x01B1EEA4);
Config();
}
public override void OnMapChange()
{
string map = GetDvar("mapname");
foreach (string key in maps.Keys)
{
if (key.Contains(map))
{
x = maps[key].xVec;
y = maps[key].yVec;
iconNum = maps[key].Icon;
Activate();
ChangeIcon();
SetPosition();
}
}
}
void Config()
{
try
{
string points = GetServerCFG("POINTS", "points", "");
if (points != "0")
{
for (int i = 1; i <= int.Parse(points); i++)
{
string loc = GetServerCFG("POINTS", string.Format("point{0}", i), "");
if (loc != null)
{
string _mp = loc.Split(',')[0];
string _x = loc.Split(',')[1];
string _y = loc.Split(',')[2];
string _icon = loc.Split(',')[3];
maps.Add(_mp, new VecXY(float.Parse(_x), float.Parse(_y), int.Parse(_icon)));
}
}
}
}
catch (Exception ex) { ServerPrint("Loading points failed: " + ex.Message); }
}
#region ----
unsafe public void Activate()
{
*(int*)activate = 1;
}
unsafe public void ChangeIcon()
{
*(int*)icon = iconNum;
}
unsafe public void Deactivate()
{
*(int*)activate = 0;
}
unsafe public void SetPosition()
{
*(float*)X = x;
*(float*)Y = y;
}
#endregion
public override unsafe ChatType OnSay(string Message, ServerClient Client)
{
if (Message.StartsWith("!icon"))
{
string[] split = Message.Split(' ');
iconNum = int.Parse(split[1]);
Activate();
ChangeIcon();
return ChatType.ChatNone;
}
return ChatType.ChatContinue;
}
}
}

![[Image: 6iiLEmPSEm0.jpg]](http://cs412822.vk.me/v412822257/282c/6iiLEmPSEm0.jpg)