RSSy MYGO.pl Opublikowano Styczeń 31, 2021 o 16:20 RSSy Udostępnij Opublikowano Styczeń 31, 2021 o 16:20 Description This plugin shows a sprite at the tank head that goes from green to red based on its HP. The idea was to make something similar to RPGs. Note: The width size doesn't change, at least I wasn't able to reduce it. (if anyone knows how to do it, with vanilla sprites, I would be grateful to know how to) FeaturesAutomatically sets the sprite color (from green to red) in a gradient way. Allow setting the Z axis based on the tank position. Allow setting the visibility by team. Allow setting the survivor visibility based sight and in the last hit on tank. Allow setting the sprites model/alpha/scale. Allow setting a dead sprite and its color. Preview Some inside info I did this plugin as a private request back in 2019, but "somehow" the code got "leaked". And I even have found some people trying to sell it. So I'm sharing an improved version with more features and bugless. Cvars A configuration file named "l4d_tank_hp_sprite.cfg" will automatically be created for you upon the first run in the "\cfg\sourcemod\" folder. PHP Code: // Alpha of alive tank sprite. // 0 = Invisible, 255 = Fully Visible // - // Default: "200" // Minimum: "0.000000" // Maximum: "255.000000" l4d_tank_hp_sprite_alive_alpha "200" // Model of alive tank sprite. // - // Default: "materials/vgui/healthbar_white.vmt" l4d_tank_hp_sprite_alive_model "materials/vgui/healthbar_white.vmt" // Scale of alive tank sprite (increases both height and width). // Note: Some range values maintain the same size. (e.g. from 0.0 to 0.38 the size doesn't change). // - // Default: "0.25" // Minimum: "0.000000" l4d_tank_hp_sprite_alive_scale "0.25" // Show the sprite to the survivor attacker, by this amount of time in seconds, after hitting the Tank. // 0 = OFF. // - // Default: "0.0" // Minimum: "0.000000" l4d_tank_hp_sprite_attack_delay "0.0" // Alpha of dead tank sprite. // 0 = Invisible, 255 = Fully Visible // - // Default: "200" // Minimum: "0.000000" // Maximum: "255.000000" l4d_tank_hp_sprite_dead_alpha "200" // Color of dead tank sprite. // Use three values between 0-255 separated by spaces ("<0-255> <0-255> <0-255>"). // - // Default: "225 0 0" l4d_tank_hp_sprite_dead_color "225 0 0" // Model of dead tank sprite. // - // Default: "materials/sprites/death_icon.vmt" l4d_tank_hp_sprite_dead_model "materials/sprites/death_icon.vmt" // Scale of dead tank sprite (increases both height and width). // Some range values maintain the size the same. // - // Default: "0.25" // Minimum: "0.000000" l4d_tank_hp_sprite_dead_scale "0.25" // Show a dead sprite when a tank dies. // 0 = OFF, 1 = ON. // - // Default: "1" // Minimum: "0.000000" // Maximum: "1.000000" l4d_tank_hp_sprite_dead_show "1" // Enable/Disable the plugin. // 0 = Disable, 1 = Enable. // - // Default: "1" // Minimum: "0.000000" // Maximum: "1.000000" l4d_tank_hp_sprite_enable "1" // Minimum distance that a client must be from the tank to see the sprite (both alive and dead sprites). // -1 = Always visible. // - // Default: "-1" // Minimum: "-1.000000" // Maximum: "9999.000000" l4d_tank_hp_sprite_fade_distance "-1" // Show the sprite to the survivor only if the Tank is on sight. // 0 = OFF, 1 = ON. // - // Default: "1" // Minimum: "0.000000" // Maximum: "1.000000" l4d_tank_hp_sprite_sight "1" // Which teams should the sprite be visible. // 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_tank_hp_sprite_team "3" // Additional Z distance based on the tank position. // - // Default: "92" // Minimum: "0.000000" l4d_tank_hp_sprite_z_axis "92" Other sprite models Spoiler The plugin has a default sprite for both alive and dead tanks. But if you wanna try some other sprite models, I found this ones that may fit too. (not all models are possible to change the color) In case you want to check for more sprite models, then you will have to use GCFScape in the pak01_dir.vpk files and extract it from the the materials folder. Note: You can change the model with: sm_cvar l4d_tank_hp_alive_model <model> The plugin will automatically precache the new model and update the tank sprite in the next hit. HP:materials/vgui/healthbar_white.vmt materials/vgui/background_survivor.vmt materials/vgui/hud/s_healthbar_outline.vmt materials/vgui/s_panel_healing_mini_prog.vmt materials/vgui/s_panel_background_glow.vmt materials/vgui/hud/healthbar_withglow_white.vmt materials/vgui/white_additive.vmt materials/vgui/divider_gradient.vmt materials/vgui/s_panel_background_alert.vmt materials/vgui/hud/healthbar_bg_player.vmt materials/vgui/hud/pz_healthbar_250.vmt materials/vgui/loadingbar.vmt materials/vgui/loadingbar_bg.vmt Death:materials/sprites/death_icon.vmt materials/sprites/skull_icon.vmt materials/sprites/headshot_icon.vmt Tank:materials/vgui/hud/zombieteamimage_tank.vmt materials/vgui/hud/pz_charge_tank.vmt Admin Commands sm_print_cvars_l4d_tank_hp_sprite => Print the plugin related cvars and their respective values to the console. (z flag required) Change Log Spoiler 1.0.1 (30-January-2021) - Public release. 1.0.0 (21-April-2019) - Private version. Notes I use a TraceRay with MASK_SHOT to determine the sprite visibility on sight. This may not work in all cases (e.g. transparent windows). The width size doesn't change based on tank HP, at least I wasn't able to reduce it. Thank you! Tonblader - for testing. Post Reply Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome. Installation Put the "l4d_tank_hp_sprite.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder. Attached Files Get Plugin or Get Source (l4d_tank_hp_sprite.sp - 26.5 KB) Wyświetl pełny artykuł Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi