Exemplo n.º 1
0
        public void scoreHUD(Entity player, int amount)
        {
            HudElem score = HudElem.CreateFontString(player, "hudsmall", 1.2f);

            score.SetPoint("CENTER", "CENTER");
            if (amount < 0)
            {
                score.Color = new Vector3(.6f, .2f, .2f);
                score.SetText("-" + amount);
            }
            else
            {
                score.Color = new Vector3(.2f, .6f, .2f);
                score.SetText("+" + amount);
            }
            score.Alpha = 0;
            score.Call("fadeovertime", .1f);
            score.Alpha = 1;
            AfterDelay(2000, () =>
            {
                score.Call("fadeovertime", .1f);
                score.Alpha = 0;
                AfterDelay(200, () =>
                           score.Call("destroy"));
            });
        }
Exemplo n.º 2
0
        public void UsablesHud(Entity player)
        {
            HudElem message = HudElem.CreateFontString(player, "hudbig", 0.6f);

            message.SetPoint("CENTER", "CENTER", 0, -50);
            OnInterval(100, () =>
            {
                bool _changed = false;
                foreach (Entity ent in usables)
                {
                    if (player.Origin.DistanceTo(ent.Origin) < ent.GetField <int>("range"))
                    {
                        switch (ent.GetField <string>("usabletype"))
                        {
                        case "door":
                            message.SetText(getDoorText(ent, player));
                            break;

                        default:
                            message.SetText("");
                            break;
                        }
                        _changed = true;
                    }
                }
                if (!_changed)
                {
                    message.SetText("");
                }
                return(true);
            });
        }
Exemplo n.º 3
0
        public void spawn(Entity player)
        {
            /*(player.SpawnedPlayer += new Action(() =>
             * {
             *  player.Health = 500;
             * });*/

            HudElem LabelA = HudElem.CreateFontString(player, "hudbig", 0.8f);

            LabelA.SetPoint("TOPRIGHT", "TOPRIGHT", -60, 10);
            LabelA.SetText("^0L^1S^3D^2 Snipe");
            LabelA.HideWhenInMenu = true;

            HudElem LabelC = HudElem.CreateFontString(player, "hudbig", 0.5f);

            LabelC.SetPoint("TOPRIGHT", "TOPRIGHT", -60, 30);
            LabelC.SetText("^5TS3: ^2codeascript.de");
            LabelC.HideWhenInMenu = true;

            HudElem LabelB = HudElem.CreateFontString(player, "hudbig", 0.8f);

            LabelB.SetPoint("TOPRIGHT", "TOPRIGHT", -60, 60);
            LabelB.SetText("...");
            LabelB.HideWhenInMenu = true;

            OnInterval(50, () =>
            {
                LabelB.SetText(DateTime.Now.ToShortTimeString());
                return(true);
            });
        }
Exemplo n.º 4
0
        public static void updateWeaponImage(Entity player, string weapon)
        {
            HudElem weaponIcon = player.GetField <HudElem>("hud_weaponIcon");

            string[] tokens     = weapon.Split('_');
            string   baseWeapon = weapon;

            if (tokens[0] == "iw5")
            {
                baseWeapon = tokens[0] + "_" + tokens[1] + "_" + tokens[2];
            }
            else if (tokens[0] == "alt")
            {
                baseWeapon = tokens[1] + "_" + tokens[2] + "_" + tokens[3];
            }

            if (horde.weaponIcons.ContainsKey(baseWeapon))
            {
                if (baseWeapon != "iw5_p99_mp" && baseWeapon != "iw5_44magnum_mp")
                {
                    weaponIcon.SetText(createHudShaderString(horde.weaponIcons[baseWeapon], true, 64, 32));
                }
                else
                {
                    weaponIcon.SetText(createHudShaderString(horde.weaponIcons[baseWeapon], true, 32, 32));
                }
            }
            else
            {
                weaponIcon.SetText("");
            }
        }
Exemplo n.º 5
0
 public hpHud()
 {
     Call("precacheShader", "black");
     base.PlayerConnected += delegate(Entity player)
     {
         HudElem bar     = HudElem.NewClientHudElem(player);
         HudElem barBack = HudElem.NewClientHudElem(player);
         barBack.X              = 395f;
         barBack.Y              = -100f;
         bar.X                  = 395f;
         bar.Y                  = -102f;
         barBack.AlignX         = "center";
         barBack.AlignY         = "bottom";
         barBack.HorzAlign      = "center";
         barBack.VertAlign      = "bottom";
         barBack.Alpha          = 0.5f;
         barBack.HideWhenInMenu = true;
         bar.AlignX             = "center";
         bar.AlignY             = "bottom";
         bar.HorzAlign          = "center";
         bar.VertAlign          = "bottom";
         bar.Alpha              = 1;
         bar.Color              = new Vector3(0f, 0f, 0f);
         bar.HideWhenInMenu     = true;
         HudElem hp = HudElem.CreateFontString(player, "default", 1f);
         hp.HideWhenInMenu = true;
         hp.SetPoint("RIGHT", "RIGHT", -25, 111);
         OnInterval(10, delegate
         {
             if (player.Health >= 100)
             {
                 bar.Color = new Vector3(0f, 5f, 0f);
                 hp.SetText("^2" + player.Health);
             }
             else if (player.Health < 100 && player.Health > 50)
             {
                 bar.Color = new Vector3(6f, 6f, 0f);
                 hp.SetText("^3" + player.Health);
             }
             else
             {
                 bar.Color = new Vector3(5f, 0f, 0f);
                 hp.SetText("^1" + player.Health);
             }
             barBack.SetShader("black", 13, (int)((float)player.Health * 1.1f + 5f));
             bar.SetShader("white", 7, (int)((float)player.Health * 1.1f));
             if (player.Health == 0)
             {
                 hp.SetText("");
             }
             return(true);
         });
     };
 }
Exemplo n.º 6
0
        private void UsableHud(Entity player)
        {
            HudElem message = HudElem.CreateFontString(player, "big", 1.5f);

            message.SetPoint("CENTER", "CENTER", 1, 115);
            message.Alpha = 0.65f;

            HudElem perk = HudElem.NewClientHudElem(player);

            player.OnInterval(100, e =>
            {
                try
                {
                    bool flag  = false;
                    bool flag2 = false;
                    foreach (var item in boxents)
                    {
                        if (player.Origin.DistanceTo(item.Origin) >= item.Range)
                        {
                            continue;
                        }
                        message.SetText(item.UsableText(player));
                        if (item.Type == BoxType.PerkColaMachine)
                        {
                            var type = ((PerkColaMachine)item).PerkCola;
                            perk.SetShader(type.GetIcon(), 15, 15);
                            perk.X = item.Origin.X;
                            perk.Y = item.Origin.Y;
                            perk.Z = item.Origin.Z + 50f;
                            perk.Call("setwaypoint", 1, 1);
                            perk.Alpha = 0.7f;
                            flag2      = true;
                        }
                        flag = true;
                    }
                    if (!flag)
                    {
                        message.SetText("");
                    }
                    if (!flag2)
                    {
                        perk.Alpha = 0f;
                    }
                }
                catch (Exception)
                {
                    message.SetText("");
                    perk.Alpha = 0;
                }

                return(player.IsPlayer);
            });
        }
Exemplo n.º 7
0
        private static void updateStreakSlot(Entity player, int slot, string streak)
        {
            string[] killstreakList = player.GetField <string[]>("killstreaks");
            killstreakList[slot] = streak;
            player.SetField("killstreaks", new Parameter(killstreakList));
            if (streak == "")
            {
                player.SetActionSlot(slot + 4, "");
            }

            //Set the HUD for this
            string[] streaks = player.GetField <string[]>("streakSlotText");
            if (streak == "")
            {
                streaks[slot] = "";
            }
            else
            {
                streaks[slot] = hordeUtils.createHudShaderString(horde.killstreakIcons[streak]) + "[{+actionslot " + (slot + 4) + "}]";
            }

            if (!player.HasField("hud_created"))
            {
                return;
            }

            HudElem list    = player.GetField <HudElem>("hud_killstreakList");
            string  newText = streaks[0] + "\n\n" + streaks[1] + "\n\n" + streaks[2] + "\n\n" + streaks[3];

            player.SetField("streakSlotText", new Parameter(streaks));
            list.SetText(newText);
        }
Exemplo n.º 8
0
        public static void givePerk(Entity player, string perk)
        {
            if (player.HasPerk(perk) || player.HasField(perk))
            {
                return;
            }

            if (perk == "_specialty_blastshield" || perk == "specialty_triggerhappy" || perk == "specialty_regenspeed")
            {
                player.SetField(perk, true);
            }
            else
            {
                player.SetPerk(perk, true, true);
            }

            List <string> perksList = player.GetField <List <string> >("perksList");

            perksList.Add(perk);
            player.SetField("perksList", new Parameter(perksList));
            player.PlayLocalSound("earn_perk");

            HudElem perks = player.GetField <HudElem>("hud_perks");
            string  text  = (string)perks.GetField("text");

            text += createHudShaderString(horde.perkIcons[perk], false, 64, 64);
            perks.SetText(text);
            perks.SetField("text", text);
        }
Exemplo n.º 9
0
 private void permKill()
 {
     info = HudElem.CreateServerFontString(HudElem.Fonts.HudBig, 1.4f);
     info.SetPoint("TOPCENTER", "TOPCENTER", 0, -15);
     info.HideWhenInMenu = true;
     info.SetText("^1Kill Mike!");
 }
Exemplo n.º 10
0
    public void startHUD()
    {
        HudElem primed = HudElem.CreateServerFontString(HudElem.Fonts.HudBig, 1);

        primed.SetPoint("TOP RIGHT", "TOPRIGHT", -45, 5);
        primed.HideWhenInMenu = true;
        primed.SetText("Primed Players:");
        primed.GlowAlpha = 0.10f;
        primed.GlowColor = new Vector3(0, 0, 0.7f);

        HudElem number = HudElem.CreateServerFontString(HudElem.Fonts.HudBig, 1);

        number.SetPoint("TOP RIGHT", "TOPRIGHT", -5, 5);
        number.HideWhenInMenu = true;
        OnInterval(100, () =>
        {
            number.SetValue(Primers.Count);
            if (Primers.Count == 0)
            {
                return(false);
            }
            return(true);
        });
        number.GlowAlpha = 0.10f;
        number.GlowColor = new Vector3(0, 0, 0.7f);
    }
Exemplo n.º 11
0
        private void playerVote(Entity player, bool yes)
        {
            if (!voteInProgress)
            {
                return;
            }

            bool playerVote       = player.GetField <int>("votedForYes") == 1;
            bool playerVoteIsNull = player.GetField <int>("votedForYes") == -1;

            if (yes && (!playerVote || playerVoteIsNull))
            {
                if (player.GetField <int>("votedForYes") != -1)
                {
                    noVotes--;
                }
                yesVotes++;
                player.SetField("votedForYes", 1);
            }
            else if (!yes && (playerVote || playerVoteIsNull))
            {
                if (player.GetField <int>("votedForYes") != -1)
                {
                    yesVotes--;
                }
                noVotes++;
                player.SetField("votedForYes", 0);
            }
            voteControls.SetText("^3[{vote yes}] ^7Yes(^2" + yesVotes + "^7)    |    ^3[{vote no}] ^7No(^2" + noVotes + "^7)");
        }
Exemplo n.º 12
0
    private void aliveCounter(Entity player)
    {
        HudElem fontString1 = HudElem.CreateFontString(player, "hudbig", 0.6f);

        fontString1.SetPoint("DOWNRIGHT", "DOWNRIGHT", -19, 60);
        fontString1.SetText("^5Allies^7:");
        fontString1.HideWhenInMenu = true;
        HudElem fontString2 = HudElem.CreateFontString(player, "hudbig", 0.6f);

        fontString2.SetPoint("DOWNRIGHT", "DOWNRIGHT", -19, 80);
        fontString2.SetText("^1Enemy^7:");
        fontString2.HideWhenInMenu = true;
        HudElem hudElem2 = HudElem.CreateFontString(player, "hudbig", 0.6f);

        hudElem2.SetPoint("DOWNRIGHT", "DOWNRIGHT", -8, 60);
        hudElem2.HideWhenInMenu = true;
        HudElem hudElem3 = HudElem.CreateFontString(player, "hudbig", 0.6f);

        hudElem3.SetPoint("DOWNRIGHT", "DOWNRIGHT", -8, 80);
        hudElem3.HideWhenInMenu = true;
        this.OnInterval(50, (Func <bool>)(() =>
        {
            string str1 = (string)player.GetField <string>("sessionteam");
            string str2 = ((int)this.Call <int>("getteamplayersalive", "axis")).ToString();
            string str3 = ((int)this.Call <int>("getteamplayersalive", "allies")).ToString();
            hudElem2.SetText(str1.Equals("allies") ? str3 : str2);
            hudElem3.SetText(str1.Equals("allies") ? str2 : str3);
            return(true);
        }));
    }
Exemplo n.º 13
0
 public override void OnPlayerKilled(Entity player, Entity inflictor, Entity attacker, int damage, string mod, string weapon, Vector3 dir, string hitLoc)
 {
     if (player.HasField("KStreak") && attacker.HasField("KStreak"))
     {
         if (player != attacker)
         {
             attacker.SetField("KStreak", attacker.GetField <int>("KStreak") + 1);
         }
         player.SetField("KStreak", 0);
         HudElem elem = NoKillsHuds[attacker.Call <int>("getentitynumber")];
         if (elem == null)
         {
             throw new Exception("AttackerNoKills is null. Attacker: " + attacker.Name);
         }
         elem.SetText("^3" + attacker.GetField <int>("KStreak").ToString());
         NoKillsHuds[attacker.Call <int>("getentitynumber")] = elem;
         HudElem elem2 = NoKillsHuds[player.Call <int>("getentitynumber")];
         if (elem2 == null)
         {
             throw new Exception("VictimNoKills is null. Victim: " + player.Name);
         }
         elem2.SetText("0");
         NoKillsHuds[player.Call <int>("getentitynumber")] = elem2;
     }
 }
Exemplo n.º 14
0
        public GTA5Wasted()
        {
            PlayerConnected += delegate(Entity player)
            {
                HudElem hud = HudElem.CreateFontString(player, "hudbig", 2.3f);
                hud.SetPoint("center", "center", 0, -20);
                hud.SetText("Wasted");
                hud.Color     = new Vector3(255f, 0f, 0f);
                hud.GlowColor = new Vector3(0.2f, 0.2f, 0.2f);
                hud.GlowAlpha = 0.8f;
                hud.Alpha     = 0f;

                HudElem overlay = HudElem.CreateIcon(player, "combathigh_overlay", 640, 480);
                overlay.X         = 0f;
                overlay.Y         = 0f;
                overlay.AlignX    = "left";
                overlay.AlignY    = "top";
                overlay.HorzAlign = "fullscreen";
                overlay.VertAlign = "fullscreen";
                overlay.Color     = new Vector3(0.2f, 0.2f, 0.2f);
                overlay.Alpha     = 0f;

                player.SetField("gta5_hud", new Parameter(hud));
                player.SetField("gta5_overlay", new Parameter(overlay));
                player.SetField("gta5_dead", 0);

                player.SpawnedPlayer += delegate
                {
                    hud.Alpha     = 0f;
                    overlay.Alpha = 0f;

                    player.SetField("gta5_dead", 0);
                };
            };
        }
Exemplo n.º 15
0
        public xyz() : base()
        {
            PlayerConnected += new Action <Entity>(player =>
            {
                Call("setdvar", "cg_LaserForceOn", 1);
                Call("setdvar", "cg_laserlight", 1);

                HudElem PlayerPos = HudElem.CreateFontString(player, "hudbig", 0.8f);
                PlayerPos.SetPoint("top left", "top left", 10, 140);
                PlayerPos.HideWhenInMenu = true;

                OnInterval(3500, () =>
                {
                    float X     = (player.Origin.X);
                    float Y     = (player.Origin.Y);
                    float Z     = (player.Origin.Z);
                    int PlayerX = (int)X;
                    int PlayerY = (int)Y;
                    int PlayerZ = (int)Z;

                    PlayerPos.SetText("Position: X: " + PlayerX + " Y: " + PlayerY + " Z: " + PlayerZ);

                    return(true);
                });
            });
        }
Exemplo n.º 16
0
        public motd() : base()
        {
            base.Call("setdvar", new Parameter[]
            {
                "motd",
                "Wilkommen auf unseren Server da wir das LSD Script gleakt haben müssen wir natürlich alles erstmal zum laufen bekommen. Für Fehler entschuldigen wir uns! BAN SYSTEN = NOTHING"
            });
            HudElem motd = HudElem.CreateServerFontString("boldFont", 1f);

            motd.SetPoint("CENTER", "BOTTOM", 0, -19);
            motd.Foreground     = true;
            motd.HideWhenInMenu = true;
            base.OnInterval(25000, delegate
            {
                motd.SetText(this.Call <string>("getdvar", new Parameter[]
                {
                    "motd"
                }));
                motd.SetPoint("CENTER", "BOTTOM", 1100, -10);
                motd.Call("moveovertime", new Parameter[]
                {
                    25
                });
                motd.X = -700f;
                return(true);
            });
        }
Exemplo n.º 17
0
        public static Dictionary <string, HudElem> CreateBar(this Entity self, byte width = 120, byte height = 9)
        {
            HudElem backGround = HudElem.CreateIcon(self, "black", width, height);

            backGround.SetPoint("center left", "center", -61, 0);
            backGround.Sort  = -3;
            backGround.Alpha = 0;

            HudElem whiteProgres = HudElem.CreateIcon(self, "progress_bar_bg", 1, height - 3);

            whiteProgres.SetPoint("center left", "center", -60, 0);
            whiteProgres.Sort  = -2;
            whiteProgres.Color = new Vector3(1, 1, 1);
            whiteProgres.Alpha = 0;

            HudElem textCapturing = HudElem.CreateFontString(self, "HudSmall", 0.8f);

            textCapturing.SetPoint("center", "center", 0, -12);
            textCapturing.SetText("Capturing...");
            textCapturing.Sort  = -1;
            textCapturing.Color = new Vector3(1, 1, 1);
            textCapturing.Alpha = 0;

            return(new Dictionary <string, HudElem>()
            {
                { "BackGround", backGround },
                { "Progress", whiteProgres },
                { "Text", textCapturing }
            });
        }
Exemplo n.º 18
0
        public void PlayerConnecte(Entity Player)
        {
            HudElem info = CreateHUD(Player);

            Player.SpawnedPlayer += new Action(() =>
            {
                Log.Write(LogLevel.All, Player.CurrentWeapon.ToString());
                Player.TakeAllWeapons();
            });
            Player.OnInterval(1000, (p) =>
            {
                bool havefound = false;
                foreach (Item i in Items)
                {
                    if (PlayerToPoint(100.0F, p, i.Place))
                    {
                        if (i.moddelentity.GetField <int>("showitem") == 1)
                        {
                            info.SetText("ITEM: ^2" + i.Name + " ^7press \"^1[{+smoke}]^7\" to pick up!");
                            havefound = true;
                        }
                    }
                }
                if (havefound == false)
                {
                    info.SetText("");
                }
                return(true);
            });
            Player.Call("notifyonplayercommand", "pickup", "+smoke");
            Player.OnNotify("pickup", (p) =>
            {
                foreach (Item i in Items)
                {
                    if (PlayerToPoint(100.0F, p, i.Place))
                    {
                        if (i.moddelentity.GetField <int>("showitem") == 1)
                        {
                            i.moddelentity.SetField("showitem", 0);
                            ItemFunc(p, i);
                            break;
                        }
                    }
                }
            });
        }
Exemplo n.º 19
0
        public static void GlobalHeaderText()
        {
            HudElem globalText = HudElem.CreateServerFontString("HudBig", 0.4f);

            globalText.SetPoint("top right", "top right", -3, 1);
            globalText.SetText(Function.Call <string>("GetDvar", "sv_hostname"));
            globalText.HideWhenInMenu = false;
            globalText.Archived       = false;
        }
Exemplo n.º 20
0
        public void connected(Entity player)
        {
            AlklPlayer.Add(player);
            player.SetField("pkills", 0);
            player.SetField("pSpeed", 1);
            player.SetField("pKillsAlle", 0);
            HudElem LabelB = HudElem.CreateFontString(player, "hudbig", 0.5f);

            LabelB.SetPoint("TOPRIGHT", "TOPRIGHT", -60, 80);
            LabelB.SetText("...");
            LabelB.HideWhenInMenu = true;

            HudElem LabelA = HudElem.CreateFontString(player, "hudbig", 0.5f);

            LabelA.SetPoint("TOPLEFT", "TOPLEFT", 10, 110);
            LabelA.SetText("^2FRIENDLY");
            LabelA.HideWhenInMenu = true;

            HudElem LabelC = HudElem.CreateFontString(player, "hudbig", 0.5f);

            LabelC.SetPoint("TOPLEFT", "TOPLEFT", 10, 120);
            LabelC.SetText("^2FRIENDLY");
            LabelC.HideWhenInMenu = true;


            OnInterval(50, () =>
            {
                int a = 0;
                int b = 0;
                foreach (Entity plo in AlklPlayer)
                {
                    a = a + 1;
                    if (plo.GetField <int>("pKillsAlle") > 4)
                    {
                        b = b + 1;
                    }
                }

                LabelB.SetText(b + "/" + a + " use ^2LSD");
                LabelA.SetText(player.GetField <int>("pkills") + "/5 ^2for next LSD!");
                LabelC.SetText(player.GetField <int>("pKillsAlle") + "/24 ^2for MOAB!");
                return(true);
            });
        }
Exemplo n.º 21
0
        public void PrintRollNames(Entity player, string name, int index, int?roll)
        {
            HudElem elem = player.HasField("rtd_rolls") ? player.GetField <HudElem>("rtd_rolls") : HudElem.CreateFontString(player, HudElem.Fonts.HudBig, 0.6f);

            elem.SetPoint("RIGHT", "RIGHT", -90, 165 - ((index - 1) * 13));
            elem.SetText(string.Format("You Have {1}", roll + 1, name));
            player.SetField("rtd_rolls", new Parameter(elem));
            player.IPrintLnBold(string.Format("You Got {1}", roll + 1, name));
            GSCFunctions.IPrintLn(string.Format("{0} got {2}", player.Name, roll + 1, name));
        }
Exemplo n.º 22
0
        public static void CreatePointHud(this Entity player)
        {
            HudElem hud = HudElem.CreateFontString(player, "default", 1f);

            hud.SetPoint("right", "right", -50, 120);
            hud.HideWhenInMenu = true;
            player.OnInterval(100, delegate(Entity ent)
            {
                if (player.GetTeam() == "allies")
                {
                    hud.SetText("^5Bonus Points ^7" + player.GetField <int>("aiz_point"));
                }
                else
                {
                    hud.SetText("");
                }
                return(player.IsPlayer);
            });
        }
Exemplo n.º 23
0
        public void PrintRollNames(Entity player, string name, int index, int?roll)
        {
            HudElem elem = player.HasField("rtd_rolls") ? player.GetField <HudElem>("rtd_rolls") : HudElem.CreateFontString(player, "bigfixed", 0.6f);

            elem.SetPoint("RIGHT", "RIGHT", -90, 165 - ((index - 1) * 13));
            elem.SetText(string.Format("[{0}] {1}", roll + 1, name));
            player.SetField("rtd_rolls", new Parameter(elem));
            player.Call("iPrintLnBold", string.Format("You rolled {0} - {1}", roll + 1, name));
            Call(334, string.Format("{0} rolled [{1}] - {2}", player.GetField <string>("name"), roll + 1, name));
        }
Exemplo n.º 24
0
        private void CreatePlayerMoneyHud(Entity player)
        {
            HudElem hud = HudElem.CreateFontString(player, "hudbig", 1f);

            hud.SetPoint("right", "right", -50, 100);
            hud.HideWhenInMenu = true;
            player.OnInterval(100, delegate(Entity ent)
            {
                if (Utility.GetPlayerTeam(player) == "allies")
                {
                    hud.SetText("^3$: ^7" + player.GetField <int>("inf2_money"));
                }
                else
                {
                    hud.SetText("");
                    return(false);
                }
                return(true);
            });
        }
Exemplo n.º 25
0
        private static void updateWeaponName(Entity player, string weapon)
        {
            HudElem weaponName = player.GetField <HudElem>("hud_weaponName");

            weaponName.Alpha = 1;
            weaponName.SetText(getWeaponName(player, weapon));
            AfterDelay(1000, () =>
            {
                weaponName.FadeOverTime(1);
                weaponName.Alpha = 0;
            });
        }
Exemplo n.º 26
0
        public static void CreateCashHud(this Entity player)
        {
            HudElem hud = HudElem.CreateFontString(player, "hudbig", 1f);

            hud.SetPoint("right", "right", -50, 100);
            hud.HideWhenInMenu = true;
            player.OnInterval(100, delegate(Entity ent)
            {
                hud.SetText("^3$ ^7" + player.GetField <int>("aiz_cash"));
                return(player.IsPlayer);
            });
        }
Exemplo n.º 27
0
        private static IEnumerator showLazeMessage(Entity player)
        {
            HudElem msg = HudElem.CreateFontString(player, HudElem.Fonts.BigFixed, 0.75f);

            msg.SetPoint("CENTER", "CENTER", 0, 150);
            msg.SetText("Lase target for Predator Strike.");

            AfterDelay(4000, () => player.Notify("uav_strike_destroy_message"));

            yield return(player.WaitTill_any("death", "uav_strike_successful", "uav_strike_cancel", "uav_strike_destroy_message"));

            msg.Destroy();
        }
Exemplo n.º 28
0
        private static void respawnBall()
        {
            //ballEnt = Call<Entity>("spawn", "script_model", location + new Vector3(0, 0, 1030));
            if (ballEnt.GetField <Entity>("parentEnt") != level)
            {
                ballEnt.GetField <Entity>("parentEnt").Delete();
                ballEnt.SetField("parentEnt", level);
            }
            ballEnt.Unlink();
            ballEnt.SetModel("viewmodel_light_marker");
            ballEnt.Angles = Vector3.Zero;
            ballEnt.SetField("beingCarried", false);
            ballEnt.SetField("carrier", level);
            ballEnt.Origin = site + new Vector3(0, 0, 1030);
            ballEnt.MoveTo(ballEnt.Origin - new Vector3(0, 0, 1000), 5, .5f, 1);
            baseFX.Show();
            playBallFX();
            GSCFunctions.TriggerFX(baseFX);
            AfterDelay(5000, () => ballEnt.SetField("isBeingCarried", false));

            ballText_allies.SetText("HOME");
            ballText_axis.SetText("HOME");
        }
Exemplo n.º 29
0
        private void CreateHudElem(Entity player)
        {
            Entity  entity = Entity.GetEntity(player.EntRef);
            HudElem elem   = HudElem.CreateFontString(entity, "hudsmall", 0.8f);

            elem.SetPoint("TOP", "TOP", -9, 2);
            elem.SetText("^5KILLSTREAK: ");
            HudElem elem2 = HudElem.CreateFontString(entity, "hudsmall", 0.8f);

            elem2.SetPoint("TOP", "TOP", 39, 2);
            elem2.SetText("^30");
            KSHuds[entity.Call <int>("getentitynumber")]      = elem;
            NoKillsHuds[entity.Call <int>("getentitynumber")] = elem2;
        }
Exemplo n.º 30
0
        public void UsablesHud(Entity player)
        {
            HudElem message = HudElem.CreateFontString(player, "hudbig", 0.7f);

            message.SetPoint("CENTER", "CENTER", 0, 150);

            OnInterval(100, () =>
            {
                bool _changed = false;
                foreach (Entity ent in usables)
                {
                    if (player.Origin.DistanceTo(ent.Origin) < UpgradeRange)
                    {
                        switch (ent.GetField <string>("tipo"))
                        {
                        case "randombox":
                            message.SetText("Press ^3[{+activate}] ^7to buy Pack-A-Punch [Cost: 5000]");
                            player.Call("notifyonplayercommand", "Rbox", "+activate");
                            player.SetField("pickgun", 1);
                            player.SetField("canBox", 1);
                            break;

                        default:
                            message.SetText("");
                            break;
                        }
                        _changed = true;
                    }
                }
                if (!_changed)
                {
                    message.SetText("");
                    player.SetField("canBox", 0);
                }
                return(true);
            });
        }