AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D1 & L4D2] Tank Rock Destroyer Announce [v1.1.1 | 18-December-2021] (https://forums.alliedmods.net/showthread.php?t=315818)

Marttt 04-26-2019 05:45

[L4D1 & L4D2] Tank Rock Destroyer Announce [v1.1.1 | 18-December-2021]
 
27 Attachment(s)
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.

Lux 04-26-2019 06:50

Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.0 | 26-April-2019]
 
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

Dragokas 04-29-2019 12:35

Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.0 | 26-April-2019]
 
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.

Lux 04-29-2019 21:46

Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.0 | 26-April-2019]
 
Quote:

Originally Posted by Marttt (Post 2649338)
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.

edwinvega86 06-20-2020 22:29

Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.3 | 02-January-2020]
 
when i play tank rush it sometimes notifies me to destroy the rock. but I never destroyed a rock?

KasperH 09-30-2020 05:49

Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.3 | 02-January-2020]
 
1 Attachment(s)
Added Hungarian. :crab:

Psyk0tik 11-09-2020 08:56

Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.3 | 02-January-2020]
 
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 (Post 2706639)
when i play tank rush it sometimes notifies me to destroy the rock. but I never destroyed a rock?


Zheldorg 01-17-2021 14:16

Re: [L4D & L4D2] Tank Rock Destroyer Announce [v1.0.3 | 02-January-2020]
 
1 Attachment(s)
Added Russian language

ZBzibing 01-23-2021 23:14

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

Originally Posted by Crasher_3637 (Post 2724355)
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?

Tank Rush 01-28-2021 09:16

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

Originally Posted by edwinvega86 (Post 2706639)
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?


All times are GMT -4. The time now is 11:08.

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