Raised This Month: $ Target: $400
 0% 

[L4D & L4D2] Tank Rock Destroyer Announce [v1.0.3 | 02-January-2020]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Marttt
Senior Member
Join Date: Jan 2019
Plugin ID:
6540
Plugin Version:
1.0.3
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Announces which player destroyed the rock thrown by the Tank.
    Old 04-26-2019 , 05:45   [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.3 | 02-January-2020]
    Reply With Quote #1

    About

    I made this plugin due to a request from a friend who asked me to find out which player destroyed the tank rock.

    Description

    This plugin will announce which player destroyed the tank rock (final hit).

    Preview



    Cvars

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

    PHP Code:
    // Alternative display mode for the chat, in case the client has the chat HUD hidden.
    // Known values: 0 = OFF, 2 = HINT, 4 = CENTER, 8 = CONSOLE, 16 = INSTRUCTOR.
    // Add numbers greater than 0 for multiple options.
    // -
    // Default: "16"
    // Minimum: "0.000000"
    // Maximum: "30.000000"
    l4d_tank_rock_destroyer_announce_altdisplay_hiddenchathud "16"

    // Alternative display mode for the hint, in case the client has the hint HUD hidden.
    // Known values: 0 = OFF, 1 = CHAT, 4 = CENTER, 8 = CONSOLE, 16 = INSTRUCTOR.
    // Add numbers greater than 0 for multiple options.
    // -
    // Default: "4"
    // Minimum: "0.000000"
    // Maximum: "29.000000"
    l4d_tank_rock_destroyer_announce_altdisplay_hiddenhinthud "4"

    // Alternative display mode for the instructor hint (L4D2 only), in case the client has it disabled or applied it to the Spitter's death (3rd event).
    // Known values: 0 = OFF, 1 = CHAT, 2 = HINT, 4 = CENTER, 8 = CONSOLE.
    // Add numbers greater than 0 for multiple
    // -
    // Default: "2"
    // Minimum: "0.000000"
    // Maximum: "15.000000"
    l4d_tank_rock_destroyer_announce_altdisplay_instructorhintdisabled "2"

    // Show the plugin message when the tank rock is destroyed by bots. 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_tank_rock_destroyer_announce_bots "1"

    // Which kind of players should the message be applied to.
    // Known values: 0 = NONE, 1 = ATTACKER, 2 = SURVIVOR, 4 = INFECTED, 8 = SPECTATOR.
    // Add numbers greater than 0 for multiple options.
    // -
    // Default: "3"
    // Minimum: "0.000000"
    // Maximum: "15.000000"
    l4d_tank_rock_destroyer_announce_displayto "3"

    // Enables/Disables the plugin. 0 = Plugin OFF, 1 = Plugin ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_tank_rock_destroyer_announce_enabled "1"

    // Turn off the plugin in these game modes, separate by commas (no spaces). Empty = none.
    // Known values: coop,realism,versus,survival,scavenge,teamversus,teamscavenge,
    // mutation[1-20],community[1-6],gunbrain,l4d1coop,l4d1vs,holdout,dash,shootzones.
    // -
    // Default: ""
    l4d_tank_rock_destroyer_announce_gamemodes_off ""

    // Turn on the plugin in these game modes, separate by commas (no spaces). Empty = all.
    // Known values: coop,realism,versus,survival,scavenge,teamversus,teamscavenge,
    // mutation[1-20],community[1-6],gunbrain,l4d1coop,l4d1vs,holdout,dash,shootzones.
    // -
    // Default: ""
    l4d_tank_rock_destroyer_announce_gamemodes_on ""

    // Turn on the plugin in these game modes.
    // Known values: 0 = all, 1 = coop, 2 = survival, 4 = versus, 8 = scavenge.
    // Add numbers greater than 0 for multiple options.
    // Example: "3", enables for "coop" (1) and "survival" (2).
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "15.000000"
    l4d_tank_rock_destroyer_announce_gamemodes_toggle "0"

    // Hint color applied to the INSTRUCTOR display mode (L4D2 only).
    // RGB Format: Three values between 0-255 separated by spaces.
    // -
    // Default: "255 255 0"
    l4d_tank_rock_destroyer_announce_hintcolor "255 255 0"

    // Hint duration applied to the INSTRUCTOR display mode (L4D2 only). 0 = OFF
    // -
    // Default: "10"
    // Minimum: "0.000000"
    l4d_tank_rock_destroyer_announce_hintduration "10"

    // Hint icon applied to the INSTRUCTOR display mode (L4D2 only).
    // More info here: https://developer.valvesoftware.com/wiki/Env_instructor_hint
    // -
    // Default: "icon_explosive_ammo"
    l4d_tank_rock_destroyer_announce_hinticon "icon_explosive_ammo"

    // Prevent the plugin being loaded on these maps, separate by commas (no spaces). Empty = none.
    // Example: "l4d_hospital01_apartment,c1m1_hotel"
    // -
    // Default: ""
    l4d_tank_rock_destroyer_announce_maps_off ""

    // Allow the plugin being loaded on these maps, separate by commas (no spaces). Empty = all.
    // Example: "l4d_hospital01_apartment,c1m1_hotel"
    // -
    // Default: ""
    l4d_tank_rock_destroyer_announce_maps_on ""

    // Displays a message to the client when a tank rock is destroyed by a client.
    // Known values: 0 = OFF, 1 = CHAT, 2 = HINT, 4 = CENTER, 8 = CONSOLE, 16 = INSTRUCTOR.
    // Add numbers greater than 0 for multiple options.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "31.000000"
    l4d_tank_rock_destroyer_announce_msgdisplay "1"

    // Check if the rock has a owner. 0 = OFF, 1 = ON.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_tank_rock_destroyer_announce_owner "0"

    // Adds the plugin tag to the displayed messages.
    // Known values: 0 = OFF, 1 = CHAT, 2 = HINT, 4 = CENTER, 8 = CONSOLE, 16 = INSTRUCTOR.
    // Add numbers greater than 0 for multiple options.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "31.000000"
    l4d_tank_rock_destroyer_announce_tagdisplay "0"

    // Which teams should activate the message.
    // Known values: 0 = NONE, 1 = SURVIVOR, 2 = INFECTED, 4 = SPECTATOR.
    // Add numbers greater than 0 for multiple options.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "7.000000"
    l4d_tank_rock_destroyer_announce_team "1" 
    Admin Commands

    PHP Code:
    sm_l4d_tank_rock_destroyer_announce_print_cvars // Prints the plugin related cvars and their respective values to the console. (needs "z" flag). 
    Change Log

    Spoiler


    Current Translations
    • en - English
    • es - Spanish
    • pt - Brazilian Portuguese

    Notes
    • TRDA stands for Tank Rock Destroyer Announce.
    • Instructor Hints do not display when the client is dead.
    • There is no INSTRUCTOR value for L4D1 on cvars, because Instructor Hints entity does not exist on L4D1.
    • HINT mode blinks when the HUD is hidden with the HIDEHUD_ALL (4) or HIDEHUD_MISCSTATUS (64) flag.

    To Do
    • Add more customization to the instructor hint with a config data file.
    • Point the instructor hint to the hud or to the attacker or to where the rock was destroyed.
    • Allow blue/red/white chat colors.

    Thank you!

    Related Plugins

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

    Installation
    • Put the "l4d_tank_rock_destroyer_announce_phrases.txt" file in your "\addons\sourcemod\translations\" folder.
    • Put the "l4d_tank_rock_destroyer_announce.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.
    Attached Files
    File Type: txt l4d_tank_rock_destroyer_announce.phrases.txt (4.4 KB, 177 views)
    File Type: sp Get Plugin or Get Source (l4d_tank_rock_destroyer_announce.sp - 314 views - 50.3 KB)
    __________________

    Last edited by Marttt; 01-03-2020 at 09:22. Reason: v1.0.3
    Marttt is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Brexit
    Old 04-26-2019 , 06:50   Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.0 | 26-April-2019]
    Reply With Quote #2

    Should use Post hook incase another plugin messes with the damage.
    PHP Code:
    public void OnEntityCreated(int entity, const char[] classname)
    {
        if (
    StrEqual(classname"tank_rock"false))
        {
            
    SDKHook(entitySDKHook_OnTakeDamagePostOnTakeDamage);
        }

    Else good plugin nice config options
    __________________
    Lux is offline
    Marttt
    Senior Member
    Join Date: Jan 2019
    Old 04-29-2019 , 11:29   Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.0 | 26-April-2019]
    Reply With Quote #3

    Lux, thanks for the feedback.

    I tried to change the hook to SDKHook_OnTakeDamagePost, but it does not work well.

    Spoiler


    The "attacker" and "inflictor" parameters return an invalid value.

    If anyone has the problem mentioned above, let me know.
    __________________

    Last edited by Marttt; 04-29-2019 at 11:48.
    Marttt is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine
    Old 04-29-2019 , 12:35   Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.0 | 26-April-2019]
    Reply With Quote #4

    You probably could hook both Pre and Post.
    In "pre", save attacker and inflictor to a global array. In "post" extract from previously saved global.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch)
    [My plugins] [My tools] [GitHub] [Articles]
    Dragokas is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Brexit
    Old 04-29-2019 , 21:46   Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.0 | 26-April-2019]
    Reply With Quote #5

    Quote:
    Originally Posted by Marttt View Post
    Lux, thanks for the feedback.

    I tried to change the hook to SDKHook_OnTakeDamagePost, but it does not work well.

    Spoiler


    The "attacker" and "inflictor" parameters return an invalid value.

    If anyone has the problem mentioned above, let me know.
    An invalid attacker is normal can happen if the attackers change from prehook to post hook probs some plugin doing stuff maybe, but OnTakeDamagePost is usually reliable in all the use cases i'v done.
    __________________
    Lux is offline
    edwinvega86
    Senior Member
    Join Date: Feb 2016
    Old 06-20-2020 , 22:29   Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.3 | 02-January-2020]
    Reply With Quote #6

    when i play tank rush it sometimes notifies me to destroy the rock. but I never destroyed a rock?
    edwinvega86 is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 19:56.


    Powered by vBulletin®
    Copyright ©2000 - 2020, vBulletin Solutions, Inc.
    Theme made by Freecode