Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
write flag position map
#1
Code:
using System;
using System.Collections.Generic;
using Addon;
using System.Threading;
using System.IO;
using System.Collections;
namespace flags
{
    public class flags : CPlugin
    {
        Dictionary<int, int> Client_HudElem_lm = new Dictionary<int, int>();

        public override void OnServerLoad()
        {
            ServerPrint("Flags plugin by Litgar loaded!");
        }

        public override void OnMapChange()
        {
            string map = GetDvar("mapname");
            if (map == "mp_paris")
            {
                Entity w = SpawnModel("script_model", "prop_flag_neutral", new Vector(-2179.646f, -205.2038f, 185.125f));
                Entity w1 = SpawnModel("script_model", "prop_flag_neutral", new Vector(-585.984f, 875.5912f, 1293.608f));
            }
        }


        public override void OnAddonFrame()
        {
            List<ServerClient> clients;
            try
            {
                clients = GetClients();
                if (clients != null && clients.Count > 0)
                {
                    foreach (ServerClient c in GetClients())
                    {
                        if (c.Other.isAlive == true)
                        {
                            HudElem hl = GetHudElement(Client_HudElem_lm[c.ClientNum]);
                            string map = GetDvar("mapname");


                            /////////
                            if (map == "mp_paris")
                            {

                                if ((Difference(c.OriginY, -205.2038f) <= 100) && (Difference(c.OriginX, -2179.646f) <= 100) && c.OriginZ >= 185.125f)
                                {
                                    hl.SetString("Press ^3F^7 to ^1Teleport");

                                    if (c.Other.ButtonPressed(Buttons.Activate))
                                    {if (c.Stats.Kills >= 5 && c.Team == Teams.Allies)
                                        {
                                            iPrintLnBold("^2Teleportation!", c);
                                            c.OriginX = -882.2723f;
                                            c.OriginY = 5308.667f;
                                            c.OriginZ = 460.125f;
                                        }
                                        else if (c.Stats.Kills == 4 && c.Team == Teams.Allies)
                                        {
                                            iPrintLnBold("^2You need^1 1 ^2Kills Zombie for teleportation!", c);
                                        }
                                           else { iPrintLnBold("^2Teleportation!", c);
                                            c.OriginX = -882.2723f;
                                            c.OriginY = 5308.667f;
                                            c.OriginZ = 460.125f;}
                                    }
                                }
                                else
                                {
                                    hl.SetString("");
                                }

                            }

                        }
                    }

                }
            }
            catch (Exception z)
            {
                ServerPrint("Error flag: " + z.Message);
            }

        }

        public static float Difference(float loc, float loc2)
        {
            return Math.Abs(loc - loc2);
        }

        public override void OnPlayerDisconnect(ServerClient client)
        {
            if (Client_HudElem_lm.ContainsKey(client.ClientNum))
            {
                HudElem info2 = GetHudElement(Client_HudElem_lm[client.ClientNum]);
                info2.Type = HudElementTypes.None;
                Client_HudElem_lm.Remove(client.ClientNum);
            }
        }

        public override void OnPlayerConnect(ServerClient client)
        {
            int HudElemNum1 = CreateHud_lm(client.ClientNum);
            if (Client_HudElem_lm.ContainsKey(client.ClientNum))
                Client_HudElem_lm[client.ClientNum] = HudElemNum1;
            else
                Client_HudElem_lm.Add(client.ClientNum, HudElemNum1);
        }

        private int CreateHud_lm(int ClientNum)
        {
            HudElem hud = CreateNewHudElem();
            hud.Type = HudElementTypes.Text;
            hud.ShowToEnt = ClientNum;
            hud.HideInMenu = true;
            hud.Font = HudElementFonts.Default;
            hud.FontScale = 1.5f;
            hud.PointType = 120;
            hud.OriginY = 180f;
            hud.OriginX = -100f;
            hud.SetString("");
            return hud.HudElementNum;
        }

    }
}
its code I use, guys help me I'm very late, if not difficult to list the positions of these
position of the attached file


Attached Files
.txt   flag.txt (Size: 1.16 KB / Downloads: 38)
Reply

#2
[Image: 31992405dede.jpg]
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#3
i don't know what u mean with this?
whats the problem?
Reply

#4
(05-29-2013, 20:57)X-Track Wrote: i don't know what u mean with this?
whats the problem?

everything is messed up I do not know how to! fkck space I attached a file with the correct coordinates for me would you add to the flag?
Reply

#5
System Threading Angel
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Make area detect. flag Teleport lewisbibo 4 4,992 10-12-2013, 18:10
Last Post: EnVi Sweden Rocks
  Player can write Fl0w_.JACKDAN 2 3,349 09-19-2013, 16:36
Last Post: Fl0w_.JACKDAN
  [Release] Flag plugin for users 1.6 archit 74 39,528 05-25-2013, 13:03
Last Post: archit
Question Help position [HARD] Tony. 2 1,966 05-14-2013, 18:06
Last Post: [HARD] Tony.
Brick [Release] Flag plugin for developers [Z00MBY] Alex 17 11,141 04-06-2013, 17:52
Last Post: Dr3am95
  Help how to write protect memory? reavenz 5 4,244 12-15-2012, 01:52
Last Post: Gam3rr0rZ
Sad [HELP]- fs_game is write protected DriesHard 9 7,815 10-06-2012, 17:01
Last Post: surtek
  HudElem Position Deviler86 7 3,952 08-04-2012, 16:19
Last Post: Nekochan
  [Request] How to convert flag? Puffiamo 6 3,974 06-22-2012, 11:37
Last Post: iPaddie
  [Request] Disable flag carrier icon TiLLeR 11 6,794 01-13-2012, 21:02
Last Post: TiLLeR

Forum Jump:


Users browsing this thread:
1 Guest(s)

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