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

RSS[L4D1 & L4D2] HP Laser [v1.0.0 | 11-February-2021]


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Description

This plugin shows a laser beam at the client's head that from green to red based on its HP.

It's similar to my [L4D1 & L4D2] Tank HP Sprite plugin.

Features
  • Automatically sets the laser beam color (from green to red) in a gradient way.
  • Allow setting the Z axis based on the client position.
  • Allow setting the visibility by team.
  • Allow setting the survivor visibility based on sight.
  • Allow setting the laser beam model/alpha/fade/size.
  • Allow setting a different laser beam width for Survivor and Infected.
  • Allow setting which SI should have a laser beam (except Witch).
  • Allow setting a laser beam that fills the bar.
  • Allow setting an outline to the laser beam.
  • Show laser beam for incapacitated survivors.

Preview

68747470733a2f2f692e696d6775722e636f6d2f

Cvars

A configuration file named "l4d_hp_laser.cfg" will automatically be created for you upon the first run in the "\cfg\sourcemod\" folder.

PHP Code:

// Alpha of the laser beam HP.
// 0 = Invisible, 255 = Fully Visible
// -
// Default: "240"
// Minimum: "0.000000"
// Maximum: "255.000000"
l4d_hp_laser_alpha "240"

// Enable/Disable the plugin.
// 0 = Disable, 1 = Enable.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_hp_laser_enable "1"

// Minimum distance that a client must be from another client to see the laser beam HP.
// 0 = Always visible.
// -
// Default: "0"
// Minimum: "0.000000"
l4d_hp_laser_fade_distance "0"

// Display a laser beam HP to fill the bar.
// Note: Disable this if you intend to show a lot of laser beams HP. The game limits the number of beams rendered at the same time when limit exceeds it may not draw then all.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_hp_laser_fill "1"

// Alpha of the laser beam HP that fills the bar.
// 0 = Invisible, 255 = Fully Visible
// -
// Default: "75"
// Minimum: "0.000000"
// Maximum: "255.000000"
l4d_hp_laser_fill_alpha "75"

// Height of the laser beam HP.
// -
// Default: "1.0"
// Minimum: "0.000000"
l4d_hp_laser_height "1.0"

// Width of the infected laser beam HP.
// -
// Default: "30.0"
// Minimum: "0.000000"
l4d_hp_laser_infected_width "30.0"

// Model of the laser beam HP.
// -
// Default: "materials/vgui/white_additive.vmt"
l4d_hp_laser_model "materials/vgui/white_additive.vmt"

// Show an outline (add 4 lasers) around the laser beam HP.
// Note: Disable this if you intend to show a lot of laser beams HP. The game limits the number of beams rendered at the same time when limit exceeds it may not draw then all.
// 0 = OFF, 1 = ON.
// -
// Default: "0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_hp_laser_outline "0"

// Outline height of the laser beam.
// -
// Default: "0.1"
// Minimum: "0.000000"
l4d_hp_laser_outline_height "0.1"

// Which Specials should have an laser beam HP.
// 1=SMOKER, 2 = BOOMER, 4 = HUNTER, 8 = SPITTER, 16 = JOCKEY, 32 = CHARGER, 64 = TANK.
// Add numbers greater than 0 for multiple options.
// Example: "127", enables laser beam HP for all SI.
// -
// Default: "64"
// Minimum: "0.000000"
// Maximum: "127.000000"
l4d_hp_laser_si "64"

// Show a laser beam HP to the survivor only if the infected is on sight.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_hp_laser_sight "1"

// Width of the survivor laser beam HP.
// -
// Default: "15.0"
// Minimum: "0.000000"
l4d_hp_laser_survivor_width "15.0"

// Which teams should have a laser beam HP sprite.
// 0 = NONE, 1 = SURVIVOR, 2 = INFECTED, 4 = SPECTATOR, 8 = HOLDOUT.
// Add numbers greater than 0 for multiple options.
// Example: "3", enables for SURVIVOR and INFECTED.
// -
// Default: "3"
// Minimum: "0.000000"
// Maximum: "15.000000"
l4d_hp_laser_team "3"

// Additional Z distance based on client position.
// -
// Default: "85"
// Minimum: "0.000000"
l4d_hp_laser_z_axis "85" 

Admin Commands
  • sm_print_cvars_l4d_hp_laser => Print the plugin related cvars and their respective values to the console. (z flag required)

Change Log

Spoiler


Notes
  • The laser beam may have a blinking effect. Probably there is nothing that can be done.
  • I use a TraceRay/TraceHull to determine the sprite visibility on sight. This may not work in all cases (e.g. transparent windows).
  • Every laser beam is drawn using TE_SetupBeamPoints.
  • Due to game engine limitations (nothing I can do), the amount of laser beams that can be drawn at same time is limited, so in case you have many clients some beams may not appear.
  • To reduce this issue you can set some cvars (l4d_hp_laser_fill / l4d_hp_laser_outline) to "0".

To Do
  • Change color when survivor is black and white.
  • Add laser beam for Witch.
  • Enable visibility through transparent glasses.

Thank you!

https://forums.alliedmods.net/showthread.php?t=330447

Related Plugins

Post Reply
  • Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome.

Installation
  • Put the "l4d_hp_laser.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.

Attached Files
File Type: sp Get Plugin or Get Source (l4d_hp_laser.sp - 31.8 KB)

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

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

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