Raised This Month: $12 Target: $400
 3% 

[L4D1 & L4D2] Tank Rock Destroyer Announce [v1.1.1 | 18-December-2021]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Plugin ID:
6540
Plugin Version:
1.1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    25 
    Plugin Description:
    Announces which player destroyed the rock thrown by the Tank
    Old 04-26-2019 , 05:45   [L4D1 & L4D2] Tank Rock Destroyer Announce [v1.1.1 | 18-December-2021]
    Reply With Quote #1

    Description

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

    Features
    • Allow setting who should see the message.
    • Allow setting who should trigger the message.

    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:
    // Enable/Disable the plugin.
    // 0 = Disable, 1 = Enable.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_tank_rock_destroyer_announce_enable "1"

    // Which teams should the message be transmitted to.
    // 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: "7"
    // Minimum: "0.000000"
    // Maximum: "15.000000"
    l4d_tank_rock_destroyer_announce_team "7"

    // Which teams should trigger the message.
    // 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: "1"
    // Minimum: "0.000000"
    // Maximum: "15.000000"
    l4d_tank_rock_destroyer_announce_team_attacker "1" 
    Admin Commands
    • sm_print_cvars_l4d_tank_rock_destroyer_announ ce => Print the plugin related cvars and their respective values to the console. (z flag required)

    Change Log

    Spoiler


    Current Translations
    • en - English
    • es - Spanish
    • hu - Hungarian
    • pt - Brazilian Portuguese
    • pt_p - Portuguese
    • ru - Russian
    • chi - Simplified Chinese
    • zho - Traditional Chinese

    Thank you!
    • KadabraZz - for the request and testing in his server.
    • Lux - for suggesting a Post Hook.
    • Crasher_3637 - for reporting a chat and translation error.
    • KasperH - for the Hungarian (hu) translation.
    • Zheldorg - for the Russian (ru) translation.
    • HarryPotter and ZBzibing - for the Simplified Chinese (chi) and Traditional Chinese (zho) translations.

    Conflicting Plugins

    Related Plugins

    Post Reply
    • Any feedback, 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 (2.6 KB, 402 views)
    File Type: sp Get Plugin or Get Source (l4d_tank_rock_destroyer_announce.sp - 458 views - 16.3 KB)
    __________________

    Last edited by Marttt; 01-22-2023 at 21:21.
    Marttt is offline
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    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
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    Lux is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine on fire
    Old 04-29-2019 , 12:35   Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.0 | 26-April-2019]
    Reply With Quote #3

    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 & FreeZone)
    [My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
    Dragokas is online now
    Lux
    Veteran Member
    Join Date: Jan 2015
    Location: Cat
    Old 04-29-2019 , 21:46   Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.0 | 26-April-2019]
    Reply With Quote #4

    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.
    __________________
    Connect
    My Plugins: KlickME
    [My GitHub]

    Commission me for L4D
    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 #5

    when i play tank rush it sometimes notifies me to destroy the rock. but I never destroyed a rock?
    edwinvega86 is offline
    KasperH
    Senior Member
    Join Date: Apr 2016
    Location: Hungary
    Old 09-30-2020 , 05:49   Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.3 | 02-January-2020]
    Reply With Quote #6

    Added Hungarian.
    Attached Files
    File Type: txt l4d_tank_rock_destroyer_announce.phrases.txt (4.9 KB, 258 views)
    __________________

    "I've Got You In My Sights!"
    KasperH is offline
    Psyk0tik
    Veteran Member
    Join Date: May 2012
    Location: Homeless
    Old 11-09-2020 , 08:56   Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.3 | 02-January-2020]
    Reply With Quote #7

    I'm not sure if it was intentional, but when someone destroys a rock, it tells every other player that they destroyed the rock themselves.

    Example: "Player A" destroys a rock.
    Chat:

    (To Player A) You destroyed the rock!
    (To Player B) Player B destroyed the rock!
    (To Player C) Player C destroyed the rock!

    I checked the code and saw that you're passing "client" as the attacker's index inside your for-loop whenever attacker != client. That means the attacker sees the right message but everyone else just sees their own name being used in the message.

    I believe someone else already reported this issue above.

    Quote:
    Originally Posted by edwinvega86 View Post
    when i play tank rush it sometimes notifies me to destroy the rock. but I never destroyed a rock?
    __________________
    Psyk0tik is offline
    Zheldorg
    Junior Member
    Join Date: Aug 2020
    Old 01-17-2021 , 14:16   Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.3 | 02-January-2020]
    Reply With Quote #8

    Added Russian language
    Attached Files
    File Type: txt l4d_tank_rock_destroyer_announce.phrases.txt (5.0 KB, 191 views)
    Zheldorg is offline
    ZBzibing
    Senior Member
    Join Date: Dec 2012
    Old 01-23-2021 , 23:14   Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.3 | 02-January-2020]
    Reply With Quote #9

    Quote:
    Originally Posted by Crasher_3637 View Post
    I'm not sure if it was intentional, but when someone destroys a rock, it tells every other player that they destroyed the rock themselves.

    Example: "Player A" destroys a rock.
    Chat:

    (To Player A) You destroyed the rock!
    (To Player B) Player B destroyed the rock!
    (To Player C) Player C destroyed the rock!

    I checked the code and saw that you're passing "client" as the attacker's index inside your for-loop whenever attacker != client. That means the attacker sees the right message but everyone else just sees their own name being used in the message.

    I believe someone else already reported this issue above.
    Yes, I also encountered the same problem in L4D1 COOP mode, can anyone fix it?
    ZBzibing is offline
    Tank Rush
    Senior Member
    Join Date: May 2019
    Location: Argentina
    Old 01-28-2021 , 09:16   Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.3 | 02-January-2020]
    Reply With Quote #10

    Quote:
    Originally Posted by edwinvega86 View Post
    when i play tank rush it sometimes notifies me to destroy the rock. but I never destroyed a rock?
    i have the same problem in versus mode
    Any solution?
    __________________
    Sorry i don't speak english very well

    --->My name is Source and I'm on Steam<---
    Discord: Source#9382
    Tank Rush 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 01:22.


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