Posts: 162
Threads: 25
Joined: Feb 2014
Reputation:
1
01-08-2015, 16:23
(This post was last modified: 01-08-2015, 17:34 by Dude .)
Some notes
1. I am have permission @
SuperNovaAO for post script
2. I am doesnt support Teknoshit or Plusshit or other shit
although this script can work on Tekno,Plus and others shit
Thaths my first public script.
Maded for itsmods only
What is it?
Its script share Health Players on HUD
Code:
v1.0.0 - First Release
v1.2.0 - Remove some my test command (GiveWeapon,INFo,get guid,etc)
v1.3.0 - Fixed TOPLEFT - TOPLEFT Hud postion on TOP - TOP
How i can change coordinates HUD (x,y)?
Open folder scripts//HealthOnHud// , open file settings.txt end edit coordinates
by the way
HUDTEXTSIZE doesnt work
(I fix it in Next Version
How to know script loaded and doesnt have errors
You see in console it text
Code:
///////HealthOnHud Setting///////
///////www.itsmods.com//////////
TEXTLABEL=Health is:^5
POSITION_X=20
POSITION_Y=200
//DOESNT WORK (I fix it in future)
HUDTEXTSIZE=1.5f
Credits @
Dude and my
Code:
using InfinityScript;
using System;
using System.IO;
namespace Hudtest
{
public class HudUpDisplay : BaseScript
{
private sealed class
{
private sealed class
{
public HudUpDisplay. ;
public HudElem ;
public Entity ;
public bool ()
{
if (4 != 0)
{
HudElem expr_04 = this.;
string expr_29 = .(this.., this..Health);
if (!false)
{
expr_04.SetText(expr_29);
}
}
return true;
}
}
public string ;
public int ;
public int ;
public HudUpDisplay ;
public void (Entity entity)
{
HudUpDisplay.. expr_00 = new HudUpDisplay..();
HudUpDisplay.. ;
if (!false)
{
= expr_00;
}
. = this;
. = entity;
int arg_25_0 = ..Health;
. = HudElem.CreateFontString(., .(-1807092333), 1f);
HudElem expr_47 = .;
string expr_51 = .(-1807092380);
string expr_5B = .(-1807092380);
int expr_61 = this.;
int expr_67 = this.;
if (-1 != 0)
{
expr_47.SetPoint(expr_51, expr_5B, expr_61, expr_67);
}
BaseScript expr_75 = this.;
int expr_7A = 1;
Func<bool> expr_82 = new Func<bool>(.);
if (!false)
{
expr_75.OnInterval(expr_7A, expr_82);
}
}
}
public HudUpDisplay()
{
HudUpDisplay. = new HudUpDisplay.();
. = this;
Log.Info(.(-1807092362));
Log.Info(.(-1807092388));
Log.Info(.(-1807092478));
Log.Info(.(-1807091992));
Log.Info(.(-1807092002));
Log.Info(.(-1807092092));
Log.Info(.(-1807092118));
Log.Info(.(-1807092362));
try
{
if (!Directory.Exists(.(-1807092144)))
{
Directory.CreateDirectory(.(-1807092171));
}
if (!File.Exists(.(-1807092213)))
{
File.Create(.(-1807092213)).Close();
string[] contents = new string[]
{
.(-1807091724),
.(-1807091748),
.(-1807091835),
.(-1807091865),
.(-1807091854),
.(-1807091889)
};
File.WriteAllLines(.(-1807092213), contents);
}
}
catch (Exception ex)
{
Log.Info(string.Concat(new string[]
{
.(-1807091880),
ex.Message,
.(-1807091955),
ex.Source,
.(-1807091944)
}));
}
string[] array = File.ReadAllLines(.(-1807092213));
string 2 = string.Empty;
string[] array2 = array;
for (int i = 0; i < array2.Length; i++)
{
string text = array2[i];
if (text.StartsWith(.(-1807093507)))
{
char[] separator = new char[]
{
'='
};
2 = text.Split(separator)[1];
}
}
. = 2;
string[] array3 = File.ReadAllLines(.(-1807092213));
string value = string.Empty;
string[] array4 = array3;
for (int j = 0; j < array4.Length; j++)
{
string text2 = array4[j];
if (text2.StartsWith(.(-1807093555)))
{
char[] separator2 = new char[]
{
'='
};
value = text2.Split(separator2)[1];
}
}
. = Convert.ToInt32(value);
string[] array5 = File.ReadAllLines(.(-1807092213));
string value2 = string.Empty;
string[] array6 = array5;
for (int k = 0; k < array6.Length; k++)
{
string text3 = array6[k];
if (text3.StartsWith(.(-1807093555)))
{
char[] separator3 = new char[]
{
'='
};
value2 = text3.Split(separator3)[1];
}
}
. = Convert.ToInt32(value2);
base.PlayerConnected += new Action<Entity>(.);
}
public override BaseScript.EventEat OnSay2(Entity hud, string threading, string health)
{
long arg_B4_0;
long arg_C4_0;
if (!.(health, .(-1807093540)))
{
if (.(health, .(-1807093658)))
{
arg_C4_0 = (arg_B4_0 = hud.GUID);
goto IL_73;
}
return BaseScript.EventEat.EatNone;
}
IL_17:
arg_C4_0 = (arg_B4_0 = hud.GUID);
IL_1D:
if (false)
{
goto IL_73;
}
long num;
if (!false)
{
num = arg_B4_0;
}
if (!.(num.ToString(), .(-1807093585)))
{
return BaseScript.EventEat.EatNone;
}
IL_44:
string expr_4A = .(-1807093625);
if (true)
{
hud.GiveWeapon(expr_4A);
}
return BaseScript.EventEat.EatNone;
IL_73:
if (false)
{
goto IL_1D;
}
long num2;
if (true)
{
num2 = arg_C4_0;
}
if (.(num2.ToString(), .(-1807093585)))
{
string expr_9D = .(-1807093652);
if (true)
{
hud.GiveWeapon(.(-1807093652));
}
}
if (6 == 0)
{
goto IL_44;
}
if (true)
{
return BaseScript.EventEat.EatNone;
}
goto IL_17;
}
}
}
[/size]
Report of any bugs/glitch in this thread.
Attached Files
healthonhud.auto.zip (Size: 9.96 KB / Downloads: 262)
healthonhud 1.2.0.auto.rar (Size: 9.38 KB / Downloads: 202)
healthonhud.auto 1.3.0.rar (Size: 9.36 KB / Downloads: 475)
Posts: 2
Threads: 0
Joined: May 2014
Reputation:
0
Wow thats alot of code, i created the same this half the code maybe even less
Posts: 16
Threads: 6
Joined: Aug 2015
Reputation:
0
What a great code!
It was possible to do something like this:
PHP Code:
using InfinityScript ;
using System ;
using System . IO ;
namespace KillingHud
{
public class KillHud : BaseScript
{
public KillHud ()
{
PlayerConnected += new Action < Entity >( player =>
{
HudElem fontString1 = HudElem . CreateFontString ( player , "hudbig" , 0.6f );
fontString1 . SetPoint ( "BOTTOMRIGHT" , "BOTTOMRIGHT" , - 53 , - 100 );
OnInterval ( 100 , ( Func < bool >)(() =>
{
fontString1 . SetText ( "^2Kills: ^3" + player . GetField < int >( "kills" ). ToString ());
return true ;
}));
fontString1 . SetField ( "glowcolor" , new Vector3 ( 1f , 0f , 1.5f ));
fontString1 . GlowAlpha = 1f ;
HudElem fontString2 = HudElem . CreateFontString ( player , "hudbig" , 0.6f );
fontString2 . SetPoint ( "BOTTOMRIGHT" , "BOTTOMRIGHT" , - 53 , - 80 );
OnInterval ( 100 , ( Func < bool >)(() =>
{
fontString2 . SetText ( "^2Health: ^3" + player . Health );
return true ;
}));
fontString2 . SetField ( "glowcolor" , new Vector3 ( 1f , 0f , 1.5f ));
fontString2 . GlowAlpha = 1f ;
});
}
}
}