Preview Teleport plugin
#11
(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; } } } } } }

#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

#13
(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.

[Image: b_560_95_1.png]



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 6,593 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 7,723 11-08-2013, 19:13
Last Post: clemi555
  Help Modifying plugin maverigh 5 7,767 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 8,444 10-19-2013, 06:59
Last Post: iRoNinja
  Make area detect. flag Teleport lewisbibo 4 6,833 10-12-2013, 18:10
Last Post: EnVi Sweden Rocks
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 3,701 09-13-2013, 09:31
Last Post: Hallla
  Search Plugin Fluid Killcam N3xT_974 1 4,040 09-10-2013, 20:27
Last Post: Nekochan
  !kill Plugin Hallla 1 3,553 09-07-2013, 22:30
Last Post: axel-le-meilleur
  God Mode Plugin - Everyone has rcon admin srskiller 4 7,935 08-28-2013, 19:03
Last Post: phillipito
  Donator Status Plugin tubwux 1 2,983 08-28-2013, 07:13
Last Post: DidUknowiPwn

Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2026 Melroy van den Berg.