Liberty Unleashed

Scripting => Script Help => Topic started by: [RU]Kewun on December 10, 2014, 03:13:31 pm

Title: i need help with gui health
Post by: [RU]Kewun on December 10, 2014, 03:13:31 pm
How i can make a health bar and disable the current health hud? how i can do that or can give me an example? please i need this... plz
Title: Re: i need help with gui health
Post by: [RU]Kewun on December 28, 2014, 09:05:46 pm
plesae.. i really need this
Title: Re: i need help with gui health
Post by: [RU]Kewun on December 29, 2014, 04:15:50 pm
But
i need like gta sa
Health bar
not disable hud
Title: Re: i need help with gui health
Post by: Pipec on January 07, 2015, 08:01:11 pm
Try to play with
http://liberty-unleashed.co.uk/LUWiki/Squirrel/Client/Functions#Progress_Bar_Functions (http://liberty-unleashed.co.uk/LUWiki/Squirrel/Client/Functions#Progress_Bar_Functions)
Title: Re: i need help with gui health
Post by: [RU]Kewun on January 07, 2015, 08:10:28 pm
but there arent even examples with it..
Title: Re: i need help with gui health
Post by: Pipec on January 07, 2015, 08:25:36 pm
Try something like:
Code: [Select]
pPlayer <- FindLocalPlayer();
GUI_Progress <- GUIProgressBar( VectorScreen( 10, ScreenHeight - 30 ), ScreenSize( 350, 30 ) );
if ( GUI_Progress )
{
       GUI_Progress.MaxValue = 100;
GUI_Progress.Visible =true
GUI_Progress.Value = pPlayer.Health.tointeger();
     }

And then put on timer ( with 1 sec delay):

Code: [Select]
GUI_Progress.Value = pPlayer.Health.tointeger();
Also, you can get desirable VectorScreen info from Wiki:

http://liberty-unleashed.co.uk/LUWiki/Squirrel/Script_Types/VectorScreen (http://liberty-unleashed.co.uk/LUWiki/Squirrel/Script_Types/VectorScreen)
Title: Re: i need help with gui health
Post by: [RU]Kewun on January 08, 2015, 07:42:02 am
how i can put on a timer? so i paste wiki example and edit it to GUI_Progress.Value = pPlayer.Health.tointeger();
 ?
can you put a completed script of this?  :-[  :-X
im a bit nooby in this squirrel...
Title: Re: i need help with gui health
Post by: Pipec on January 08, 2015, 10:17:32 am
Forget about timer

Complete CLIENT SCRIPT:


Code: [Select]
pPlayer <- FindLocalPlayer();

function onScriptLoad()
{
print( "Loaded LU Test Script" );

GUI_Progress <- GUIProgressBar( VectorScreen( 10, ScreenHeight - 30 ), ScreenSize( 350, 30 ) );
if ( GUI_Progress )
{
       GUI_Progress.MaxValue = 100;
       GUI_Progress.Visible = true
     }
return 1;
}


function onClientRender()
{

if(pPlayer && GUI_Progress)
{
  GUI_Progress.Value = pPlayer.Health.tointeger();
}
}
Title: Re: i need help with gui health
Post by: [RU]Kewun on January 08, 2015, 01:11:00 pm
i added this completed client script and i dont see any health bar.. i put client 1,of course but i dont see the bar of health and whne i put client 0 it has error line 1
Title: Re: i need help with gui health
Post by: [RU]Kewun on August 26, 2015, 12:25:21 pm
still no answer..
Title: Re: i need help with gui health
Post by: [RU]Kewun on September 21, 2015, 01:02:55 pm
since nobody knows , im locking this topic