Author Topic: i need help with gui health  (Read 2264 times)

[RU]Kewun

  • Full Member
  • ***
  • Posts: 126
  • Karma: +11/-21
  • C.R.C Marshal
    • View Profile
i need help with gui health
« on: December 10, 2014, 04: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
« Last Edit: December 28, 2014, 05:42:12 pm by SmallRhino »
Fear the wrath of god!


[RU]Kewun

  • Full Member
  • ***
  • Posts: 126
  • Karma: +11/-21
  • C.R.C Marshal
    • View Profile
Re: i need help with gui health
« Reply #1 on: December 28, 2014, 10:05:46 pm »
plesae.. i really need this
Fear the wrath of god!


[RU]Kewun

  • Full Member
  • ***
  • Posts: 126
  • Karma: +11/-21
  • C.R.C Marshal
    • View Profile
Re: i need help with gui health
« Reply #2 on: December 29, 2014, 05:15:50 pm »
But
i need like gta sa
Health bar
not disable hud
Fear the wrath of god!


Pipec

  • Newbie
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile

[RU]Kewun

  • Full Member
  • ***
  • Posts: 126
  • Karma: +11/-21
  • C.R.C Marshal
    • View Profile
Re: i need help with gui health
« Reply #4 on: January 07, 2015, 09:10:28 pm »
but there arent even examples with it..
Fear the wrath of god!


Pipec

  • Newbie
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Re: i need help with gui health
« Reply #5 on: January 07, 2015, 09: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

[RU]Kewun

  • Full Member
  • ***
  • Posts: 126
  • Karma: +11/-21
  • C.R.C Marshal
    • View Profile
Re: i need help with gui health
« Reply #6 on: January 08, 2015, 08: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...
« Last Edit: January 08, 2015, 08:45:16 am by SmallRhino »
Fear the wrath of god!


Pipec

  • Newbie
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Re: i need help with gui health
« Reply #7 on: January 08, 2015, 11: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();
}
}

[RU]Kewun

  • Full Member
  • ***
  • Posts: 126
  • Karma: +11/-21
  • C.R.C Marshal
    • View Profile
Re: i need help with gui health
« Reply #8 on: January 08, 2015, 02: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
Fear the wrath of god!


[RU]Kewun

  • Full Member
  • ***
  • Posts: 126
  • Karma: +11/-21
  • C.R.C Marshal
    • View Profile
Re: i need help with gui health
« Reply #9 on: August 26, 2015, 01:25:21 pm »
still no answer..
Fear the wrath of god!


[RU]Kewun

  • Full Member
  • ***
  • Posts: 126
  • Karma: +11/-21
  • C.R.C Marshal
    • View Profile
Re: i need help with gui health
« Reply #10 on: September 21, 2015, 02:02:55 pm »
since nobody knows , im locking this topic
Fear the wrath of god!


 

© Liberty Unleashed Team.