AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Off-Topic / General Chat (https://forums.alliedmods.net/forumdisplay.php?f=38)
-   -   Plugin: SuperHero Monitor - Shows True HP/AP on screen (https://forums.alliedmods.net/showthread.php?t=36540)

vittu 06-06-2006 06:00

Plugin: SuperHero Monitor - Shows True HP/AP on screen
 
9 Attachment(s)
SuperHero Monitor v1.5

Code:

****************************************************************************
*              ******** AMX Mod X 1.80 and above Only ********
*              ***** SuperHero Mod 1.2.0 and above Only ******
*              *** Must be loaded after SuperHero Mod core ***
*
*  Description:
*    This plugin will display a hud message to the user showing their true
*      current health and armor just above chat messages. Might possibly
*      add other things into the message in the future, suggestions?
*
*  Why:
*    When a users health is over 255 in the HUD it loops over again
*      starting from 0. When a users armor is over 999 it does not show the
*      correct number rather it shows a hud symbol and the last few digits.
*
*  Who:
*    This plugin is intended for SuperHero Mod servers that have heroes that
*      make it possible to have more then 255 hp or more then 999 armor.
*
*  Known Issues:
*    If using the REPLACE_HUD option, clients radar is also removed from the
*      hud. If lots of hud messages are being displayed at the same time the
*      monitor may flash briefly, but does not happen enough to be concerned.
*
****************************************************************************
*
*  http://shero.rocks-hideout.com/
*
*  Notes: Currently there are no cvars, message will not display when sh mod is off.
*          However, loop will still run incase shmod is enabled again. Plugin tested
*          at 800x600 to 1280x1024.
*
*  Changelog:
*  v1.5 - vittu - 10/28/10
*            - Fixed possible issue with get_players array size.
*
*  v1.4 - vittu - 10/19/09
*            - Changed to make each item optional
*            - Added option to show when godmode is on
*            - Added option to show information of player being spectated (similar to wc3ft)
*            (Update required use of SuperHero Mod 1.2.0 or above, also made the code ugly.)
*
*  v1.3 - vittu - 07/06/07
*            - Fixed bug forgot to make sure entity was valid in think forward
*          - Added requested option to show Gravity and Speed, set as disabled define because it
*              gets checked constantly
*
*  v1.2 - vittu - 06/13/07
*            - Conversion to Fakemeta
*          - Optimization of code all around, much improved
*
*  v1.1 - vittu - 06/11/06
*            - Used a hud sync object instead of taking up a single hud channel (suggested by jtp10181)
*            - Added option to remove the hud's hp/ap and place message there (suggested by Freecode)
*
*  v1.0 - vittu - 06/05/06
*            - Initial Release
*
*  Thanks:
*            - OneEyed for the basis of an entity as a task
*
****************************************************************************

Code:

/****** Changeable defines requie recompile *******/


/********* Uncomment to replace HUD hp/ap **********/
//#define REPLACE_HUD

/********* Uncomment the ones you want to display **********/
#define MONITOR_HP
#define MONITOR_AP
//#define MONITOR_GRAVITY
//#define MONITOR_SPEED
//#define MONITOR_GODMODE
#define MONITOR_SPEC


lumbsta 06-06-2006 06:13

This plugins is definitely useful! I've always been asked: Why don't I have 700hp???? Now, these annoying questions won't be asked again. THX vittu!

Emp` 06-06-2006 09:41

ill browse through the code later... gj

Freecode 06-06-2006 15:30

Good idea vittu. What if you removed hp/ap from the hud and added your plugin as the hp/ap ?

The_One 06-06-2006 16:28

gj have alot of people saying "i havent got extra hp" lol very nice plugin :wink:

jtp10181 06-06-2006 22:06

only problem is that it sucks away a HUD channel. You should use a hud sync object so it will cause the least possible interference with other hud messages, with this it would always try to use an open hud channel first, then if they are all in use it would erase an existing message.

infernal2 06-07-2006 08:38

looks really good wuld be nice in other server, but in my serve max hp is 200 so i hawe no problems :P

D o o m 06-07-2006 10:11

I like it :)
Good job vittu :)

Jonathan Young 06-09-2006 20:16

Sounds good, i will install it on my server asap. Hope their are upgrades to this plugin to make it more neat.

vittu 06-11-2006 06:29

Upated: Using jtp's and freecode suggestions

Now requires: AMX Mod X 1.70 or above

Update Features:
  • Now uses a hud sync object as to interfere less with other hud messages. It will try to find an available hud channel. If one is not available it will overwrite one instead of constantly overwriting a single hud channel. Meaning it will try not to overwrite other hud messages now.
  • Now with optional replacement of Hud's AP/HP, to use this mode you must uncomment the define in the sma and recompile the plugin. *Warning: this mode also removes the Radar from the hud, as seen in the second image above.


All times are GMT -4. The time now is 05:11.

Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.