• 3 Vote(s) - 4.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Release] Flag plugin for users 1.6
#61
Or, instead of trying to compile an outdated version you could just download the latest one from the first page
  Reply
#62
How to find the coordinates for a new flag?
  Reply
#63
(01-21-2013, 15:24)Krusty123 Wrote: How to find the coordinates for a new flag?

You need to create plugin and make iPrintLnBold with client origin.
iPrintLnBold(string.Format("X: {0} Y: {1} Z: {2}", client.originx, client.originy, client.originz));
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
  Reply
#64
I am almost sure there is no vector property origin even though I remember requesting it
  Reply
#65
Easiest way is to use the teleporter plugin and use !savepos
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

  Reply
#66
@archit there is a 'origin' vector in the client struct.

The are the entries of the ServerClient struct:
Name
String holding the player's name
XUID
String holding the player's XUID (As shown in the 'status' command)
ClientNum
Integer holding the player's client number on the server
Rate
Integer holding the player's current rate
Ping
Integer holding the player's current ping
IP
IPAddress type holding the player's IP
Team
Teams type holding the player's team
SpectateType
SpectateTypes type holding the player's permissions for spectating
Origin[X,Y,Z]
Float type holding the player's origin (See example code)
ConnectionState
ConnectionStates type holding the players connection state
Stance
Stances type holding the players current Stance
Visible
Boolean holding the player's visibility (GSC: hide() and show())

You can find it here:
http://addon.teamsdk.com/?q=node/46

I hope this helps...
  Reply
#67
It is not a vector they are 3 different floats(OriginX,OriginY,OriginZ instead of vector Origin) I wonder though why is it written like that in documentation as it is misleading
  Reply
#68
I thought 'ServerClient.Origin' was like a Vector3...

Sorry if it is wrong, but in my doc i only copy/paste the old docs of nukem and zxz0o0... but maybe I misunderstood it when I read the docs...

Anyway thank you for the clarification.
  Reply
#69
(01-12-2013, 20:29)hillbilly Wrote:
(01-12-2013, 20:25)archit Wrote: 1.4 doesn't show flag but teleport still works?

This is the code that works for both, just tested it, flags show up fine using as flag and as a tp kill zone, attached is flag.dll with radius made a little bigger

Code:
using System;
using System.Collections.Generic;
using Addon;

namespace teleport
{
    public class Class1 : CPlugin
    {
        struct ProcessFlags
        {
            public Vector point;
            public int radius;
            public Vector destination;
            public ProcessFlags(Vector point, int radius, Vector destination)
            {
                this.point = point;
                this.radius = radius;
                this.destination = destination;
            }
        };

        List<ProcessFlags> Flags = new List<ProcessFlags>();

        public override void OnServerLoad()
        {
            ServerPrint("TELEPORTER plugin loaded!");
        }
        public override void OnMapChange()
        {
            Flags.Clear();
            makeflags();
        }
        public override void OnFastRestart()
        {
            OnMapChange();
        }
        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 OnAddonFrame()
        {
            List<ServerClient> clients = GetClients();
            if (clients != null)
            {
                foreach (ProcessFlags it in Flags)
                {
                    foreach (ServerClient Client in clients)
                    {
                        if (Distance(new Vector(Client.OriginX, Client.OriginY, Client.OriginZ), it.point) <= it.radius)//same as flag
                        {
                            Client.OriginX = it.destination.X;
                            Client.OriginY = it.destination.Y;
                            Client.OriginZ = it.destination.Z;
                        }
                    }
                }
            }
        }

        void makeflags()
        {
            try
            {
                string flag = GetServerCFG("TELEPORTER", "flag", "0");
                if (flag != "0")
                {

                    Dictionary<string, Vector> flagsorigin = new Dictionary<string, Vector>();
                    Dictionary<string, Vector> flagsdesti = new Dictionary<string, Vector>();
                    for (int i = 1; i <= int.Parse(flag); i++)
                    {
                        string flaged = GetServerCFG("TELEPORTER", string.Format("flag{0}", i.ToString()), "null");
                        if (flaged != null)
                        {
                            string map = flaged.Split(',')[0];
                            string vector = flaged.Split(',')[1];
                            string vector2 = vector.Split('(')[1];
                            string vector3 = vector2.Split(')')[0];
                            string vec1 = vector3.Split('_')[0];
                            string vec2 = vector3.Split('_')[1];
                            string vec3 = vector3.Split('_')[2];
                            Vector vec = new Vector(Convert.ToSingle(vec1), Convert.ToSingle(vec2), Convert.ToSingle(vec3));
                            flagsorigin.Add(string.Format("{0},{1}", map, i.ToString()), vec);
                            vector = flaged.Split(',')[2];
                            vector2 = vector.Split('(')[1];
                            vector3 = vector2.Split(')')[0];
                            vec1 = vector3.Split('_')[0];
                            vec2 = vector3.Split('_')[1];
                            vec3 = vector3.Split('_')[2];
                            vec = new Vector(Convert.ToSingle(vec1), Convert.ToSingle(vec2), Convert.ToSingle(vec3));
                            flagsdesti.Add(string.Format("{0},{1}", map, i.ToString()), vec);

                        }
                    }
                    foreach (string key in flagsdesti.Keys)
                    {
                        if (key.Split(',')[0] == GetDvar("mapname"))
                        {
                            Entity en = SpawnModel("script_brushmodel", "prop_flag_neutral", flagsdesti[key]);
                        }
                    }

                    foreach (string key in flagsdesti.Keys)
                    {
                        if (key.Split(',')[0] == GetDvar("mapname"))
                        {
                            Entity en = SpawnModel("script_brushmodel", "prop_flag_neutral", flagsorigin[key]);
                            Flags.Add(new ProcessFlags(flagsorigin[key], 50, flagsdesti[key]));
                        }
                    }
                }
            }
            catch (Exception e)
            {
                ServerPrint(e.ToString());
            }
        }
    }
}
Ok i updated my game version and now plugin is loading like the plugin from this post name teleport plugin loaded and plugin which is attaached in this msg is loaded as teleporter plugin loaded finally the pluggins loaded for me now but the thing is that no flag are shown in any map i just put this command in my sv_config [TELEPORTER]
Convert=false
//True or false will convert older type entries into ones that are compatible with newer plugin
[TELEPORTER]
flags=3
flag1=mp_dome,(1343.3_1742.7_-254.8),(1322_1455.7_-255)//flag must be followed by a number
flag2=mp_paris,(-2179.646_-205.2038_185.125),(-549.5192_931.428_1300.724)
flag3=mp_paris,(-585.984_875.5912_1293.608),(-2113.61_-117.1516_185.125)
flag4=mp_paris,(1114_-831_-15),(1562_-1320_572)
just a copy paste from old msgs but flags are not showing for me and how do only teleport works?
  Reply
#70
You need to do the new format it is on the first post
  Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)