Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Hp and ammo hud

Author
Message
Monoxide_
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: Pennsylvania
Posted: 6th Nov 2008 01:04
If i wanted to make a HUD that would display health and ammo as lets say a bar, how would i go about doing it. I know how to call a HUD into appearing but im not sure about showing health or ammo.
My idea would be something like a loading bar but i have no idea how it works.
Sorry if it is a stupid question.
PS im using plys mod so i can declare variables and such

http://s3.bitefight.org/c.php?uid=185043
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 6th Nov 2008 02:15
Grab V1.07 Beta 2, if you haven't already! That makes this script a cake-walk compared to doing it the old fashioned way.


Make a bar image for both your health and ammo as if they were at 100% and make sure it's designed so that if it's "squished", it won't look any different.


Now, keeping track of ammo and health are easy in Ply's Mod because you can use the Internal Variables for checking/using them. For quick reference the variable for health is $PH (player's current health). I'll show you how to do the Health bar and you can mold in your Ammo bar based on it.


Start off by loading up the HUD and putting it where you want. Now you will also want to declare a variable for doing small calculations (I always call mine "CalcVar"). Now, to make your bar scale itself, simply set your calculation variable to the player's current health, then divide by the maximum amount of health the player can have (default is 500), and then multiply by 100... You can simplify the divide/multiply if you want, but that's how it goes generically. Now just "scalehudx" your health bar by your calculation variable! (Use "scalehudy" for a vertical bar)


You can do this in 2 lines of script.
1 for making the HUD and declaring your variable, and 1 for constantly updating the health bar.


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.
Monoxide_
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: Pennsylvania
Posted: 8th Nov 2008 06:23
Thanks i just got beta 2 b4 checcking this thread and realized its alot more possible now, along with an XP, Armor, and power-up time limit HUD
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 8th Nov 2008 07:40
Quote: "an XP, Armor, and power-up time limit HUD"


Now you're thinking!

Hope you enjoy it, and lemme know how it turns out.


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.

Login to post a reply

Server time is: 2024-11-24 13:48:25
Your offset time is: 2024-11-24 13:48:25