Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

[CS:S/CS:GO] Health Bar V1.0


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Since nobody decided to publish a health bar plugin for CS:S I decided to do one. I have drawn the health bar sprites myself using PAINT.NET with VTF plugin. VMT uses "Sprite" with proper sprite orientation so that the health bar looks 2D from any angle (looks 3D and become thinner vmt specify it as "unlitgeneric" or other. Health bar changes length and colour at 5% health interval Added two cvars to make it more customizable.

Cvars:
Code:

sm_healthbar_time 5.0 // Time before health bar disappear when player receive damage. Default = 5.0, Always show health bar = 0
sm_healthbar_render 1 /* Health bar rendermode.
Default = 1, you can change it to other mode to see how the health bar is displayed in different environment.
Other settings includes integers from 0 to 10 (see: https://developer.valvesoftware.com/wiki/Render_Modes)*/

How it works:
If sm_healthbar_time is set to 0, healthbar will always displayed above player head until death.
If sm_healthbar_time is non-zero, healthbar will only appear when player takes damage and disappears after the set value. Continuous damage will reset the timer.

If any of the cvars is changed during game:
  • Set to 0: All healthbar would be removed.
  • Set to non-zero: All health bar will be recreated.

Installation:
  1. Place sm_healthbar.smx in cstrike\addons\sourcemod\plugins
  2. Extract the sprites to your cstrike\materials folder
  3. Done

Limitations:
Does not work with other health regeneration mod or when player health is changed through commands like SetEntData since health change is detect through only the "player_hurt" event. Sorry, will try to implement.

Bugs:
  • If you decide to change cvar during gameplay, health bar will shift position if player is crouching or jumping. Therefore Recommend you to place the cvars in server.cfg and not change them during game play.
Thats all so far. I have tried testing it over and over and did checks like if player is alive, is health bar already created ... etc. So tel me if you find any bugs other than stated in my limitations above! :)

If anyone can test if this plugin works for other games please tell me thanks!!!

Attached Files
File Type: zip material.zip (14.8 KB)
File Type: sp Get Plugin or Get Source (sm_healthbar.sp - 9.2 KB)

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...