[Help] make text permanent on the screen

Posts 1–3 of 3 · Page 1 of 1
[Help] make text permanent on the screen
in my script, very easy, but i have a problem:
the text that i want to display disappear in a few minutes, how can i make it permanentely during the match??

script:
Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Timers;
using InfinityScript;

namespace Myscript
{

    public class My : BaseScript
    {
        public HudElem info;


        public override void OnPlayerDamage(Entity player, Entity inflictor, Entity attacker, int damage, int dFlags, string mod, string weapon, Vector3 point, Vector3 dir, string hitLoc)
        {
            info.SetText("\r\r");
            if (mod == "MOD_FALLING" || damage != 0 || player.Health > 0)
            {

                info.SetPoint("TOPRIGHT", "TOPRIGHT", -10, 0);
                info.HideWhenInMenu = true;
                info.SetText("^2Health: " + player.Health + "\n^1Damage: " + damage);
            }
        }

        public My()
            : base()
        {
            info = HudElem.CreateServerFontString("hudsmall", 0.7f);
            info.SetPoint("BOTTOMLEFT", "BOTTOMLEFT", 10, -120);
            info.HideWhenInMenu = false;
            info.SetText("^1Server & Plugin ^5By ^8Peppe PE");
        }
    }
}
p.s. i'm noob in programming.
Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Timers;
using System.Threading;
using InfinityScript;

namespace Myscript
{
    int interval = 0; //In seconds
    int max = 0; //In seconds
    public class My : BaseScript
    {
        public HudElem info;

        public override void OnPlayerDamage(Entity player, Entity inflictor, Entity attacker, int damage, int dFlags, string mod, string weapon, Vector3 point, Vector3 dir, string hitLoc)
        {
            info.SetText("\r\r");
            if (mod == "MOD_FALLING" || damage != 0 || player.Health > 0)
            {
                info.SetPoint("TOPRIGHT", "TOPRIGHT", -10, 0);
                info.HideWhenInMenu = true;
                for(int i = 0; i <= max; i++)
                {
                info.SetText("^2Health: " + player.Health + "\n^1Damage: " + damage); 
                Thread.Sleep(interval * 1000);
                }            
             }
        }

        public My()
            : base()
        {
            info = HudElem.CreateServerFontString("hudsmall", 0.7f);
            info.SetPoint("BOTTOMLEFT", "BOTTOMLEFT", 10, -120);
            info.HideWhenInMenu = false;
            info.SetText("^1Server & Plugin ^5By ^8Peppe PE");
        }
    }
}
You have to change interval & max variables.
This will write same text every [interval] seconds.
thank you..
where can i found all functions to write script?
how can i count kill of a player?
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us