« [Release] Bubble Chat
[Release] GUI Health & Armour Bar

Anik

  • Sr. Member
  • Posts: 355
[Release] GUI Health & Armour Bar
« on March 29th, 2017, 11:35 AM »Last edited on March 30th, 2017, 12:28 PM
Credits :-

GUI Health & Armour Bar
This snippet replaces the native Health and armour. And adds new GUI Health And armour bar

Codes Here :-

Client side :-

Code: [Select]
function Script::ScriptLoad()
{
CreateNameTag();
}

function Script::ScriptProcess( )
{
if( NameTag.Spawned )
{
local plr = World.FindLocalPlayer();
if ( plr.Health.tointeger() != NameTag.HP )
{
NameTag.HPprogressBar.Value = plr.Health;
NameTag.HP = plr.Health;
NameTag.HPLabel.Text = plr.Health.tointeger()+"%";
}
if( plr.Armour > 2 && (!(NameTag.ArmourprogressBar.Flags & GUI_FLAG_VISIBLE))) NameTag.ArmourprogressBar.AddFlags( GUI_FLAG_VISIBLE );
if (NameTag.ArmourprogressBar.Flags & GUI_FLAG_VISIBLE)
{
if ( plr.Armour.tointeger() != NameTag.Armour )
{
NameTag.ArmourLabel.Text = plr.Armour.tointeger()+"%";
NameTag.ArmourprogressBar.Value = plr.Armour;
NameTag.Armour = plr.Armour;
if( plr.Armour < 3 ) NameTag.ArmourprogressBar.RemoveFlags( GUI_FLAG_VISIBLE );
}
}
else NameTag.ArmourprogressBar.RemoveFlags( GUI_FLAG_VISIBLE );
}
}

NameTag <-
{
HPprogressBar = null
ArmourprogressBar = null
HPLabel = null
Spawned = false
HP = 100
Armour = 0
ArmourLabel = null
}

function DelNameTag( )
{
NameTag.HPprogressBar = null;
NameTag.ArmourprogressBar = null;
NameTag.HPLabel = null;
NameTag.ArmourLabel = null;
NameTag.Spawned = false;
NameTag.HP = 100;
NameTag.Armour = 0;
}

function CreateNameTag( )
{
local plr = World.FindLocalPlayer(), scr = GUI.GetScreenSize();

NameTag.HPprogressBar = GUIProgressBar();
NameTag.HPprogressBar.Pos = VectorScreen( scr.X * 0.763, scr.Y * 0.148 );
NameTag.HPprogressBar.Size = VectorScreen( scr.X * 0.07, scr.Y * 0.05 );
NameTag.HPprogressBar.StartColour = Colour( 40, 255, 40 );
NameTag.HPprogressBar.EndColour = Colour( 180, 110, 110 );
NameTag.HPprogressBar.MaxValue = 100;
NameTag.HPprogressBar.BackgroundShade = 0.3;
NameTag.HPprogressBar.Thickness = 2;

NameTag.ArmourprogressBar = GUIProgressBar();
NameTag.ArmourprogressBar.Pos = VectorScreen( scr.X * 0.65, scr.Y * 0.148 );
NameTag.ArmourprogressBar.Size = VectorScreen( scr.X * 0.07, scr.Y * 0.05 );
NameTag.ArmourprogressBar.StartColour = Colour( 40, 40, 180 );
NameTag.ArmourprogressBar.EndColour = Colour( 40, 40, 0 );
NameTag.ArmourprogressBar.MaxValue = 100;
NameTag.ArmourprogressBar.BackgroundShade = 0.3;
NameTag.ArmourprogressBar.Thickness = 2;

NameTag.HPLabel = GUILabel( );
NameTag.HPLabel.Text = "100%";
NameTag.HPLabel.Pos = VectorScreen( scr.X * 0.007, scr.X * 0.005 );
NameTag.HPLabel.FontSize = scr.Y * 0.022;
NameTag.HPLabel.TextColour = Colour( 255, 255, 255 );

NameTag.ArmourLabel = GUILabel( );
NameTag.ArmourLabel.Text = "100%";
NameTag.ArmourLabel.Pos = VectorScreen( scr.X * 0.007, scr.X * 0.005 );
NameTag.ArmourLabel.FontSize = scr.Y * 0.022;
NameTag.ArmourLabel.TextColour = Colour( 255, 255, 255 );

NameTag.HPprogressBar.AddChild( NameTag.HPLabel );
NameTag.ArmourprogressBar.AddChild( NameTag.ArmourLabel );

if( plr.Armour < 3 ) NameTag.ArmourprogressBar.RemoveFlags( GUI_FLAG_VISIBLE );
NameTag.Spawned = true;
}

function GUI::GameResize(width, height)
{
local scr = GUI.GetScreenSize();
NameTag.HPprogressBar.Pos = VectorScreen( scr.X * 0.763, scr.Y * 0.148 );
NameTag.HPprogressBar.Size = VectorScreen( scr.X * 0.07, scr.Y * 0.05 );
NameTag.ArmourprogressBar.Pos = VectorScreen( scr.X * 0.65, scr.Y * 0.148 );
NameTag.ArmourprogressBar.Size = VectorScreen( scr.X * 0.07, scr.Y * 0.05 );
NameTag.HPLabel.FontSize = scr.Y * 0.022;
NameTag.ArmourLabel.FontSize = scr.Y * 0.022;
NameTag.HPLabel.Pos = VectorScreen( scr.X * 0.007, scr.X * 0.005 );
NameTag.ArmourLabel.Pos = VectorScreen( scr.X * 0.007, scr.X * 0.005 );
}

Video :-


https://www.youtube.com/watch?v=0VWNElddL5g#

Zone_Killer

  • Jr. Member
  • K.D.M No.1
  • Posts: 99
Bohemia Is God Of Punjabi Rap
Yo Yo Honey Singh tou chutiya hai

vito

  • Sr. Member
  • Posts: 406
[Release] Re: GUI Health & Armour Bar
« Reply #2, on March 29th, 2017, 11:57 AM »
Awesome, I hope devs will made in next update option to hide native GUI.

Anik

  • Sr. Member
  • Posts: 355

Luis_Labarca

  • Sr. Member
  • Hello :D
  • Posts: 289
My server ...:: RPG ::...
IP: 149.56.143.129:8195

Anik

  • Sr. Member
  • Posts: 355

Mohamed

  • Full Member
  • Regards, We3da
  • Posts: 247
[Release] Re: GUI Health & Armour Bar
« Reply #6,  »
Niice, one question:-
Thi its Work For Rel003 ?
Feel Free To PM Me For Any Support, I'm Care.
Anyway u can Contact Me Ingame!
Ingame Name: [AFt]We3da^
My Own Server: ViceEvil Server

!

  • Sr. Member
  • Don't feel shy while zooming on h*r... >>zeus#5155
  • Posts: 380

Discord: zeus#5155

=RK=MarineForce

  • Sr. Member
  • WAR IS HELL!
  • Posts: 445
Try to UnderStand ME!

« [Release] Bubble Chat