Posts: 47
Threads: 2
Joined: Jul 2012
Reputation:
0
09-05-2012, 18:55
(This post was last modified: 09-06-2012, 12:26 by surtek.)
(07-27-2012, 15:09)archit Wrote: This should do
Thanks to @master131 for Distance code
Code: public static double Distance(Vector vec1, Vector vec2)
{
return Math.Sqrt(Math.Pow(vec1.X - vec2.X, 2) + Math.Pow(vec1.Y - vec2.Y, 2) + Math.Pow(vec1.Z - vec2.Z, 2));
}
public override void OnMapChange()
{
Entity flag = SpawnModel("script_brushmodel", "prop_flag_neutral", new Vector(1343.3f, 1742.7f, -254.8f)); // change with your flag co-ordinates
}
public override void OnAddonFrame()
{
if (GetClients() != null)
{
foreach (ServerClient Client in GetClients())
{
if (Distance(new Vector(Client.OriginX, Client.OriginY, Client.OriginZ), new Vector(1343.3f, 1742.7f, -254.8f)) <= 50)//same as flag
{
Client.OriginX = 1322f;//where to teleport
Client.OriginY = 1455.7f;
Client.OriginZ=-255f;
}
}
}
}
Can someone release this plugin or make it??? btw @architi get some errors.
This errors: The name 'SpawnModel does not exist in the current context.
The name 'GetClients' does not exist in the current context.
The name 'GetClients' does not exist in the current context.
this the code:
Code: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Addon;
namespace Mynamespace
{
public class Myclass
{
public static double Distance(Vector vec1, Vector vec2)
{
return Math.Sqrt(Math.Pow(vec1.X - vec2.X, 2) + Math.Pow(vec1.Y - vec2.Y, 2) + Math.Pow(vec1.Z - vec2.Z, 2));
}
public override void OnMapChange()
{
Entity flag = SpawnModel("script_brushmodel", "prop_flag_neutral", new Vector(1343.3f, 1742.7f, -254.8f)); // change with your flag co-ordinates
}
public override void OnAddonFrame()
{
if (GetClients() != null)
{
foreach (ServerClient Client in GetClients())
{
if (Distance(new Vector(Client.OriginX, Client.OriginY, Client.OriginZ), new Vector(1343.3f, 1742.7f, -254.8f)) <= 50)//same as flag
{
Client.OriginX = 1322f;//where to teleport
Client.OriginY = 1455.7f;
Client.OriginZ = -255f;
}
}
}
}
}
}
Posts: 285
Threads: 15
Joined: Nov 2011
Reputation:
12
(09-05-2012, 18:55)jari333 Wrote: (07-27-2012, 15:09)archit Wrote: This should do
Thanks to @master131 for Distance code
Code: public static double Distance(Vector vec1, Vector vec2)
{
return Math.Sqrt(Math.Pow(vec1.X - vec2.X, 2) + Math.Pow(vec1.Y - vec2.Y, 2) + Math.Pow(vec1.Z - vec2.Z, 2));
}
public override void OnMapChange()
{
Entity flag = SpawnModel("script_brushmodel", "prop_flag_neutral", new Vector(1343.3f, 1742.7f, -254.8f)); // change with your flag co-ordinates
}
public override void OnAddonFrame()
{
if (GetClients() != null)
{
foreach (ServerClient Client in GetClients())
{
if (Distance(new Vector(Client.OriginX, Client.OriginY, Client.OriginZ), new Vector(1343.3f, 1742.7f, -254.8f)) <= 50)//same as flag
{
Client.OriginX = 1322f;//where to teleport
Client.OriginY = 1455.7f;
Client.OriginZ=-255f;
}
}
}
}
Can someone release this plugin or make it??? btw @architi get some errors.
This errors: The name 'SpawnModel does not exist in the current context.
The name 'GetClients' does not exist in the current context.
The name 'GetClients' does not exist in the current context.
this the code:
Code: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Addon;
namespace Mynamespace
{
public class Myclass
{
public static double Distance(Vector vec1, Vector vec2)
{
return Math.Sqrt(Math.Pow(vec1.X - vec2.X, 2) + Math.Pow(vec1.Y - vec2.Y, 2) + Math.Pow(vec1.Z - vec2.Z, 2));
}
public override void OnMapChange()
{
Entity flag = SpawnModel("script_brushmodel", "prop_flag_neutral", new Vector(1343.3f, 1742.7f, -254.8f)); // change with your flag co-ordinates
}
public override void OnAddonFrame()
{
if (GetClients() != null)
{
foreach (ServerClient Client in GetClients())
{
if (Distance(new Vector(Client.OriginX, Client.OriginY, Client.OriginZ), new Vector(1343.3f, 1742.7f, -254.8f)) <= 50)//same as flag
{
Client.OriginX = 1322f;//where to teleport
Client.OriginY = 1455.7f;
Client.OriginZ = -255f;
}
}
}
}
}
}
You forgot to inherit CPlugin
Off topic :I will release a plugin soon
Posts: 47
Threads: 2
Joined: Jul 2012
Reputation:
0
(09-06-2012, 12:21)archit Wrote: (09-05-2012, 18:55)jari333 Wrote: (07-27-2012, 15:09)archit Wrote: This should do
Thanks to @master131 for Distance code
Code: public static double Distance(Vector vec1, Vector vec2)
{
return Math.Sqrt(Math.Pow(vec1.X - vec2.X, 2) + Math.Pow(vec1.Y - vec2.Y, 2) + Math.Pow(vec1.Z - vec2.Z, 2));
}
public override void OnMapChange()
{
Entity flag = SpawnModel("script_brushmodel", "prop_flag_neutral", new Vector(1343.3f, 1742.7f, -254.8f)); // change with your flag co-ordinates
}
public override void OnAddonFrame()
{
if (GetClients() != null)
{
foreach (ServerClient Client in GetClients())
{
if (Distance(new Vector(Client.OriginX, Client.OriginY, Client.OriginZ), new Vector(1343.3f, 1742.7f, -254.8f)) <= 50)//same as flag
{
Client.OriginX = 1322f;//where to teleport
Client.OriginY = 1455.7f;
Client.OriginZ=-255f;
}
}
}
}
Can someone release this plugin or make it??? btw @architi get some errors.
This errors: The name 'SpawnModel does not exist in the current context.
The name 'GetClients' does not exist in the current context.
The name 'GetClients' does not exist in the current context.
this the code:
Code: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Addon;
namespace Mynamespace
{
public class Myclass
{
public static double Distance(Vector vec1, Vector vec2)
{
return Math.Sqrt(Math.Pow(vec1.X - vec2.X, 2) + Math.Pow(vec1.Y - vec2.Y, 2) + Math.Pow(vec1.Z - vec2.Z, 2));
}
public override void OnMapChange()
{
Entity flag = SpawnModel("script_brushmodel", "prop_flag_neutral", new Vector(1343.3f, 1742.7f, -254.8f)); // change with your flag co-ordinates
}
public override void OnAddonFrame()
{
if (GetClients() != null)
{
foreach (ServerClient Client in GetClients())
{
if (Distance(new Vector(Client.OriginX, Client.OriginY, Client.OriginZ), new Vector(1343.3f, 1742.7f, -254.8f)) <= 50)//same as flag
{
Client.OriginX = 1322f;//where to teleport
Client.OriginY = 1455.7f;
Client.OriginZ = -255f;
}
}
}
}
}
}
You forgot to inherit CPlugin
Off topic :I will release a plugin soon Okay, if you make this plugin. That would be awesome.
|