AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Show Health (1.0.2) (https://forums.alliedmods.net/showthread.php?t=87061)

exvel 03-06-2009 06:39

Show Health (1.0.2)
 
2 Attachment(s)
Show Health
Version: 1.0.2


[IMG]http://img196.**************/img196/4317/about1q.jpg[/IMG] Description:

Shows your health on the screen. Can be usefull on ZombieMod servers to show zombie's large health.
Servers running this plugin.


Requirements:[IMG]http://img38.**************/img38/3856/install3.png[/IMG] Installation:
  1. Put the showhealth.smx into addons/sourcemod/plugins folder.
  2. Put the showhealth.phrases.txt into addons/sourcemod/translations folder.
  3. Start your server. Config file will be automatically generated.
  4. Configure plugin.showhealth.cfg in cfg/sourcemod folder and restart your server.
[IMG]http://img20.**************/img20/2184/settings3.png[/IMG] Settings:
Quote:

  • sm_show_health
    default: 1
    Enabled/Disabled show health functionality, 0 = off/1 = on
  • sm_show_health_on_hit_only
    default: 1
    Defines the whether when to show a health text:
    0 = always show your health on a screen
    1 = show your health only when somebody hit you
  • sm_show_health_text_area
    default: 1
    Defines the area for health text:
    1 = in the hint text area
    2 = in the center of the screen

[IMG]http://img30.**************/img30/5649/lang2.jpg[/IMG] Supported Languages:
  • English
  • Russian

[IMG]http://img269.**************/img269/2707/screenshot2j.png[/IMG] Screenshot:
[IMG]http://img12.**************/img12/3028/hl22009032018541893.jpg[/IMG]

[IMG]http://img38.**************/img38/4548/changelog1.png[/IMG] Changelog:
  • 1.0.2
    • Players now can switch plugin on/off through the !settings menu
    • Added translations
  • 1.0.1
    • Minor code changes for better performance
    • Added config file
  • 1.0.0
    • Initial Release

Credits: SourceMod Developers, Antithasys.

crazyeffect 03-06-2009 11:25

Re: Show Health v1.0.0
 
Cool :D

{7~11} TROLL 03-06-2009 16:40

Re: Show Health v1.0.0
 
any support for l4d in the future? would love to use it on there

Antithasys 03-06-2009 18:16

Re: Show Health v1.0.0
 
Few suggestions:
  • Use MaxClients instead of setting a global with GetMaxClients() on map load.
  • Hook the change of your cvars with HookConVarChange()
  • Call AutoExecConfig(true, "plugin.showhealth") to create and load your convars in a .cfg file
  • Use FCVAR_DONTRECORD on your public cvar so its not written to the .cfg file.
  • Use OnConfigsExecuted() to load some globals for your convars
  • Use your globals instead of GetConVarBool() and GetConVarInt() in your timer callback.

The reason for these suggestions is because you don't really want to have to query the convar every 2 seconds in your timer call back for each client. There are times when code like this is better, but being used in a repeating timer is not one of them. Additionally, loading your convars into your own config file makes it very easy for a server admin to set the settings.

Lastly, if your plugin had a lot of support files and such a .zip file would be better. Since you only have the plugin itself, and it can be compiled on the forums, please upload only the .sp file.

:)

exvel 03-07-2009 04:00

Re: Show Health v1.0.0
 
Antithasys, these are good suggestions. :) I knew about all of these but I was too lazy to optimize code in such way for such simple plugin. If you think it is necessary, I just will rewrite it when I will have a free time.
p.s. do you think AutoExecConfig is needed for only a 3 cvars that actualy can be left by default? :)

exvel 03-07-2009 04:02

Re: Show Health v1.0.0
 
Quote:

Originally Posted by {7~11} TROLL (Post 775403)
any support for l4d in the future? would love to use it on there

Plugin should work in l4d. Are you having any problems with it?

exvel 03-07-2009 09:03

Re: Show Health v1.0.1
 
1.0.1
  • Minor code changes for better performance
  • Added config file

{7~11} TROLL 03-07-2009 10:53

Re: Show Health v1.0.1
 
gonna install this today :D +karama good work bro

antihacker 03-07-2009 10:55

Re: Show Health v1.0.1
 
It works in left 4 dead, nearly perfect, just if i use the mode sm_show_health_text_are with 2, the text is so small, that its not really good to read.

exvel 03-07-2009 11:53

Re: Show Health v1.0.1
 
Quote:

Originally Posted by antihacker (Post 775769)
It works in left 4 dead, nearly perfect, just if i use the mode sm_show_health_text_are with 2, the text is so small, that its not really good to read.

Sorry but this is a defect of l4d HUD that can't be changed.


All times are GMT -4. The time now is 04:59.

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