Exemplo n.º 1
0
        private void Credits(Entity ent)
        {
            HudElem credits = HudElem.CreateFontString(ent, "hudbig", 1.0f);

            credits.SetPoint("CENTER", "BOTTOM", 0, -70);
            credits.Call("settext", "CHINA Magic Infect Extreme Edition");
            credits.Alpha = 0f;
            credits.SetField("glowcolor", new Vector3(1f, 0.5f, 1f));
            credits.GlowAlpha = 1f;

            HudElem credits2 = HudElem.CreateFontString(ent, "hudbig", 0.6f);

            credits2.SetPoint("CENTER", "BOTTOM", 0, -90);
            credits2.Call("settext", "Vesion 1.1.7 Code in: github.com/A2ON");
            credits2.Alpha = 0f;
            credits2.SetField("glowcolor", new Vector3(1f, 0.5f, 1f));
            credits2.GlowAlpha = 1f;

            ent.OnNotify("tab", entity =>
            {
                credits.Alpha  = 1f;
                credits2.Alpha = 1f;
            });

            ent.OnNotify("-tab", entity =>
            {
                credits.Alpha  = 0f;
                credits2.Alpha = 0f;
            });
        }
Exemplo n.º 2
0
        public static void GamblerText(this Entity player, string text, Vector3 color, Vector3 glowColor, float intensity, float glowIntensity)
        {
            var hud = HudElem.CreateFontString(player, "hudbig", 2);

            hud.SetPoint("CENTERMIDDLE", "CENTERMIDDLE", 0, 0);
            hud.SetText(text);
            hud.Color     = color;
            hud.GlowColor = glowColor;
            hud.Alpha     = 0;
            hud.GlowAlpha = glowIntensity;

            hud.ChangeFontScaleOverTime(0.25f, 0.75f);
            hud.Call("FadeOverTime", 0.25f);
            hud.Alpha = intensity;

            player.AfterDelay(250, ent => player.Call("playLocalSound", "mp_bonus_end"));

            player.AfterDelay(3000, ent =>
            {
                hud.ChangeFontScaleOverTime(0.25f, 2f);
                hud.Call("FadeOverTime", 0.25f);
                hud.Alpha = 0;
            });

            player.AfterDelay(4000, ent => hud.Call("destroy"));
        }
Exemplo n.º 3
0
        public static void Credits(this Entity player)
        {
            HudElem credits = HudElem.CreateFontString(player, "hudbig", 1.0f);

            credits.SetPoint("CENTER", "BOTTOM", 0, -70);
            credits.Call("settext", "Project Cirno (INF3) for FFA");
            credits.Alpha = 0f;
            credits.SetField("glowcolor", new Vector3(1f, 0.5f, 1f));
            credits.GlowAlpha = 1f;

            HudElem credits2 = HudElem.CreateFontString(player, "hudbig", 0.6f);

            credits2.SetPoint("CENTER", "BOTTOM", 0, -90);
            credits2.Call("settext", "Vesion 1.0. Code in: https://github.com/A2ON");
            credits2.Alpha = 0f;
            credits2.SetField("glowcolor", new Vector3(1f, 0.5f, 1f));
            credits2.GlowAlpha = 1f;

            player.Call("notifyonplayercommand", "tab", "+scores");
            player.OnNotify("tab", entity =>
            {
                credits.Alpha  = 1f;
                credits2.Alpha = 1f;
            });

            player.Call("notifyonplayercommand", "-tab", "-scores");
            player.OnNotify("-tab", entity =>
            {
                credits.Alpha  = 0f;
                credits2.Alpha = 0f;
            });
        }
Exemplo n.º 4
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.º 5
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.º 6
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.º 7
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.º 8
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.º 9
0
        public static void TextPopup2(this Entity player, string text)
        {
            HudElem hud;

            if (!player.HasField("textpopup2"))
            {
                player.SetField("textpopup2", new Parameter(HudElem.NewClientHudElem(player)));
            }
            hud = player.GetField <HudElem>("textpopup2");
            if (hud != null)
            {
                hud.Call("destroy");
            }

            hud = HudElem.CreateFontString(player, "hudbig", 0.8f);
            hud.SetPoint("BOTTOMCENTER", "BOTTOMCENTER", 0, -105);
            hud.SetText(text);
            hud.Alpha     = 0.85f;
            hud.GlowColor = new Vector3(0.3f, 0.9f, 0.9f);
            hud.GlowAlpha = 0.55f;
            hud.Call("SetPulseFX", 100, 3000, 1000);
            hud.ChangeFontScaleOverTime(0.1f, 0.75f);
            player.AfterDelay(100, e =>
            {
                hud.ChangeFontScaleOverTime(0.1f, 0.65f);
            });
        }
Exemplo n.º 10
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.º 11
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.º 12
0
        public void OnPlayerConnect(Entity player)
        {
            //Reseting killstreak on player connect
            player.SetField("playerKillStreak", 0);
            //Client Performance dvar
            if (Call <int>("getDvarInt", "sv_clientDvars") != 0)
            {
                player.SetClientDvar("cg_objectiveText", Call <String>("getDvar", "sv_objText"));
                player.SetClientDvar("sys_lockThreads", "all");
                player.SetClientDvar("com_maxFrameTime", "1000");
                player.SetClientDvar("rate ", Call <string>("getDvar", "sv_rate"));
                player.SpawnedPlayer += () =>
                {
                    player.SetClientDvar("cg_objectiveText", Call <String>("getDvar", "sv_objText"));
                };
            }
            if (Call <int>("getDvarInt", "sv_forceSmoke") != 0)
            {
                player.SetClientDvar("fx_draw", "1");
            }

            //Killstreak Related Code
            var killstreakHud = HudElem.CreateFontString(player, "hudsmall", 0.8f);

            killstreakHud?.SetPoint("TOP", "TOP", -9, 2);
            killstreakHud?.SetText("^5Killstreak: ");
            killstreakHud.HideWhenInMenu = true;

            var noKills = HudElem.CreateFontString(player, "hudsmall", 0.8f);

            noKills?.SetPoint("TOP", "TOP", 39, 2);
            noKills?.SetText("^20");
            noKills.HideWhenInMenu = true;

            KillStreakHud[GetEntityNumber(player)]  = killstreakHud;
            NoKillsHudElem[GetEntityNumber(player)] = noKills;

            player.SpawnedPlayer += () =>
            {
                if (player.HasField("frozen"))
                {
                    if (player.GetField <int>("frozen") == 1)
                    {
                        player.Call("freezecontrols", true);
                    }
                }
            };
            player.OnNotify("giveloadout", delegate(Entity entity)
            {
                if (entity.HasField("frozen"))
                {
                    if (entity.GetField <int>("frozen") == 1)
                    {
                        entity.Call("freezecontrols", true);
                    }
                }
            });
        }
Exemplo n.º 13
0
        private static void CreateRankHud(this Entity player)
        {
            var hud = HudElem.CreateFontString(player, "hudbig", 1);

            hud.SetPoint("BOTTOMCENTER", "BOTTOMCENTER", 0, -80);
            hud.Alpha = 0;
            hud.Color = new Vector3(0.5f, 0.5f, 0.5f);

            player.SetField("scorepopup", new Parameter(hud));
        }
Exemplo n.º 14
0
        private static void CreateRankHud(this Entity player)
        {
            var hud = HudElem.CreateFontString(player, "hudbig", 1);

            hud.SetPoint("BOTTOMCENTER", "BOTTOMCENTER", 0, -80);
            hud.Alpha = 0;
            hud.Color = new Vector3(0.5f, 0.5f, 0.5f);

            ScorePopupHuds[player.EntRef] = hud;
        }
Exemplo n.º 15
0
        public HudElem CreateHUD(Entity player)
        {
            HudElem info;

            info = HudElem.CreateFontString(player, "hudbig", 1f);
            info.SetPoint("CENTER", "BOTTOM", 0, -50);
            info.HideWhenInMenu = true;
            info.SetText("Item:^2 G36B");
            info.SetText("");
            return(info);
        }
Exemplo n.º 16
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.º 17
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.º 18
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.º 19
0
        private void OnPlayerConnect(Entity player)
        {
            InfinityScript.BaseScript.Players.Remove(player);
            Vector3 saved = player.GetOrigin();
            Vector3 color;

            color.X = 0;
            color.Y = 1;
            color.Z = 2;
            var credit    = HudElem.CreateFontString(player, HudElem.Fonts.HudSmall, 14);  // Credit mainly to Slvr99
            var velocity  = HudElem.CreateFontString(player, HudElem.Fonts.HudSmall, 14f);
            var controls  = HudElem.CreateFontString(player, HudElem.Fonts.HudSmall, 14f); //  I didn't use loop because I have few elements here to construct
            var controls2 = HudElem.CreateFontString(player, HudElem.Fonts.HudSmall, 14f);
            var controls3 = HudElem.CreateFontString(player, HudElem.Fonts.HudBig, 14f);

            controls.Archived  = true;
            controls2.Archived = true;
            controls3.Archived = true;

            velocity.Color      = color + color + color + color + color;
            controls3.GlowColor = color;
            controls3.GlowAlpha = 1;

            velocity.SetText("0");
            controls.SetText("^3E^7 Save Location");
            controls2.SetText("^3F^7 Teleport Location");
            controls3.SetText("CodJumper");
            credit.SetText("Made Possible by ^1Slvr99");

            credit.HorzAlign    = HudElem.HorzAlignments.Left;
            credit.VertAlign    = HudElem.VertAlignments.Top;
            controls.HorzAlign  = HudElem.HorzAlignments.Left;
            controls.VertAlign  = HudElem.VertAlignments.Top;
            velocity.VertAlign  = HudElem.VertAlignments.Top;
            velocity.HorzAlign  = HudElem.HorzAlignments.Left;
            controls2.HorzAlign = HudElem.HorzAlignments.Left;
            controls2.VertAlign = HudElem.VertAlignments.Top;
            controls3.HorzAlign = HudElem.HorzAlignments.Center;
            controls3.VertAlign = HudElem.VertAlignments.Top;

            velocity.X  = 10;
            velocity.Y  = 235;
            controls.X  = 10;
            controls2.X = 10;
            controls.Y  = 300;
            controls2.Y = 325;
            credit.X    = 10;
            credit.Y    = 350;
            controls3.X = -10;
            controls3.Y = 5;
            Tick       += () => Monitor(player, ref saved, ref velocity);
        }
Exemplo n.º 20
0
 private void KillstreakUseWaiter(Entity ent, string weapon)
 {
     if (weapon == "killstreak_uav_mp")
     {
         var elem = HudElem.CreateFontString(ent, "hudlarge", 2.5f);
         elem.SetPoint("BOTTOMCENTER", "BOTTOMCENTER");
         elem.SetText("Lase target for Predator Strike.");
         ent.TakeWeapon("killstreak_uav_mp");
         ent.AfterDelay(3500, player => elem.SetText(""));
         ent.GiveWeapon("uav_strike_marker_mp");
         ent.SwitchToWeapon("uav_strike_marker_mp");
     }
 }
Exemplo n.º 21
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.º 22
0
        public static void GamblerText(this Entity player, string text, Vector3 color, Vector3 glowColor, float intensity, float glowIntensity)
        {
            HudElem hud;

            if (!player.HasField("gambletexthud"))
            {
                hud = HudElem.CreateFontString(player, "hudbig", 2);
                player.SetField("gambletexthud", new Parameter(hud));
            }
            else
            {
                hud = player.GetField <HudElem>("gambletexthud");
            }
            hud.Call("destroy");

            hud = HudElem.CreateFontString(player, "hudbig", 2);
            var entref = hud.Entity.EntRef;

            hud.SetPoint("CENTERMIDDLE", "CENTERMIDDLE", 0, 0);
            hud.SetText(text);
            hud.Color     = color;
            hud.GlowColor = glowColor;
            hud.Alpha     = 0;
            hud.GlowAlpha = glowIntensity;

            hud.ChangeFontScaleOverTime(0.25f, 0.75f);
            hud.Call("FadeOverTime", 0.25f);
            hud.Alpha = intensity;

            player.AfterDelay(250, ent => player.Call("playLocalSound", "mp_bonus_end"));

            player.AfterDelay(3000, ent =>
            {
                if (hud.Entity.EntRef == entref)
                {
                    hud.ChangeFontScaleOverTime(0.25f, 2f);
                    hud.Call("FadeOverTime", 0.25f);
                    hud.Alpha = 0;
                }
            });

            player.AfterDelay(4000, ent =>
            {
                if (hud.Entity.EntRef == entref)
                {
                    hud.ChangeFontScaleOverTime(0.25f, 2f);
                    hud.Call("FadeOverTime", 0.25f);
                    hud.Alpha = 0;
                }
            });
        }
Exemplo n.º 23
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.º 24
0
        public static void CreateFlyingScore(Entity e, int score)
        {
            HudElem h = HudElem.CreateFontString(e, "hudsmall", 1.0f);

            h.Call("setvalue", score);
            h.SetField("x", 640 / 2);
            h.SetField("y", 480 / 2);
            h.Call("moveovertime", 1f);
            h.SetField("x", 640);
            h.SetField("y", 0);
            e.AfterDelay(1000, ent =>
            {
                h.Call("destroy");
                UpdateHudMoney(e);
            });
        }
Exemplo n.º 25
0
        public static void WelcomeMessage(this Entity player, List <string> messages, Vector3 color, Vector3 glowColor, float intensity, float glowIntensity)
        {
            var list = new List <HudElem>();

            foreach (var item in messages)
            {
                player.AfterDelay((messages.IndexOf(item) + 1) * 500, e =>
                {
                    var hud = HudElem.CreateFontString(player, "objective", 1.5f);
                    hud.SetPoint("TOPMIDDLE", "TOPMIDDLE", 0, 45 + messages.IndexOf(item) * 15);
                    hud.FontScale = 6;
                    hud.Color     = color;
                    hud.SetText(item);
                    hud.Alpha     = 0;
                    hud.GlowColor = glowColor;
                    hud.GlowAlpha = glowIntensity;

                    hud.ChangeFontScaleOverTime(0.2f, 1.5f);
                    hud.Call("fadeovertime", 0.2f);
                    hud.Alpha = intensity;

                    list.Add(hud);
                });
            }
            player.AfterDelay(messages.Count * 500 + 4000, e =>
            {
                foreach (var item in list)
                {
                    player.AfterDelay((list.IndexOf(item) + 1) * 500, en =>
                    {
                        item.ChangeFontScaleOverTime(0.2f, 4.5f);
                        item.Call("fadeovertime", 0.2f);
                        item.Alpha = 0;
                        if (list.IndexOf(item) == list.Count - 1)
                        {
                            player.AfterDelay(1000, ex =>
                            {
                                foreach (var item2 in list)
                                {
                                    item2.Call("destroy");
                                }
                            });
                        }
                    });
                }
            });
        }
Exemplo n.º 26
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.º 27
0
        private static void ServerWelcomeTittle(Entity player, string tittle, float[] rgb)
        {
            player.SetField("welcome", 0);
            player.SpawnedPlayer += new Action(() =>
            {
                if (player.GetField <int>("welcome") == 0)
                {
                    HudElem serverWelcome = HudElem.CreateFontString(player, HudElem.Fonts.HudBig, 1f);
                    serverWelcome.SetPoint("TOPCENTER", "TOPCENTER", 0, 165);
                    serverWelcome.SetText(tittle);
                    serverWelcome.GlowColor = (new Vector3(rgb[0], rgb[1], rgb[2]));
                    serverWelcome.GlowAlpha = 1f;
                    serverWelcome.SetPulseFX(150, 4700, 700);
                    player.SetField("welcome", 1);

                    AfterDelay(5000, () => { serverWelcome.Destroy(); });
                }
            });
        }
Exemplo n.º 28
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.º 29
0
        private void startUI(Entity player)
        {
            HudElem title = HudElem.CreateFontString(player, HudElem.Fonts.HudBig, 1);

            title.SetPoint("CENTER", "CENTER");
            title.HideWhenInMenu = true;
            title.Foreground     = true;
            title.SetText("Select Specialist ([{+actionslot 5}] & [{vote no}]):\n" + getSpecialistName(player.GetField <int>("currentSelection")));
            player.SetField("nameUI", title);

            HudElem ring = HudElem.CreateIcon(player, "compassping_portable_radar_sweep", 64, 64);

            ring.SetPoint("BOTTOMRIGHT", "BOTTOMRIGHT", -50, -50);
            ring.Color          = new Vector3(1, 1, 1);
            ring.Foreground     = true;
            ring.Alpha          = .9f;
            ring.Archived       = true;
            ring.HideWhenInMenu = true;
            player.SetField("hud_timerRing", ring);
        }
Exemplo n.º 30
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);
            });
        }