Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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;
                    }
                }
            }
        }
    }
}
Reply

#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
Reply

#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]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 4,167 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 4,748 11-08-2013, 19:13
Last Post: clemi555
  [Release] Bunker Plugin 1.3 archit 68 41,565 10-30-2013, 11:59
Last Post: clacki
  Help Modifying plugin maverigh 5 5,670 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 5,179 10-19-2013, 06:59
Last Post: iRoNinja
  Make area detect. flag Teleport lewisbibo 4 4,989 10-12-2013, 18:10
Last Post: EnVi Sweden Rocks
  [Release] Yurio Map Plugin Yurio 101 62,288 09-26-2013, 13:38
Last Post: First_Semyon
Brick [Release] v1.1 ChangeMap/NextMap Plugin without any configuration milchshake 23 18,639 09-23-2013, 13:18
Last Post: SgtLegend
  Help !say Plugin (like the !say from GodPlugin) Hallla 0 2,711 09-13-2013, 09:31
Last Post: Hallla
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 33,277 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks

Forum Jump:


Users browsing this thread:
1 Guest(s)

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