[L4D2] Inject Adrenaline to your Teammates
2 Attachment(s)
Based on the idea by MilanesaTM found here
This Plugin allows you to inject adrenaline to nearby survivor teammates. Works on any gamemode. How to Inject:
ConVars:
The duration of the adrenaline effect can be adjusted using the build in ConVar: adrenaline_duration REQUIREMENTS: This plugin requires Left 4 DHooks Direct to use and for compiling. Installation: Put the inject_adre.smx into addons/sourcemod/plugins Load a different map or restart the server or use "sm plugins load inject_adre" in the server console. Using Get Plugin will fail due to the dependency of Left 4 DHooks Direct |
Re: [L4D2] Inject Adrenaline to your Teammates
Nice plugin!
Some suggestions: It might be better to use SDKHook_WeaponSwitchPost to detect when holding adrenaline - (instead of using SDKHook_WeaponSwitchPost's "weapon" variable use this instead: weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"); to detect the weapon correctly, sometimes the "weapon" variable SDKHooks returns is not actually current one and causes issues, e.g. I think on Ladders). That optimizes it instead of constantly checking "IsCurrentWeaponAdrenaline". Also the current method is constantly creating "char szClassName[32];" which would be better to set as "static char szClassName[32];", but if you switch to SDKHooks method that would be even better. Because "OnPlayerRunCmd" is called for every client connected practically every frame, it is required to optimize this as best as possible. For example check if they're pressing the key before validating the client, the else statement looks good because you're checking if IN_USE was pressed already. You have this: PHP Code:
Your "Inject_Adrenaline" function could be optimized, and probably elsewhere, I haven't checked the whole plugin. For example in this function you return when "if(g_bInUse[client] == false)" - this should be at the top before you start using more expensive native calls etc such as in the function "IsValidInjector". These optimizations become important on servers with many plugins/players/slow hardware. These types of optimizations become noticeable especially when more plugins are optimized like that. |
Re: [L4D2] Inject Adrenaline to your Teammates
Update Version 1.0.1
- Updated the code with some more optimiziation. Thanks to Silvers |
Re: [L4D2] Inject Adrenaline to your Teammates
Good job Xerox, thanks a lot! :D
|
Re: [L4D2] Inject Adrenaline to your Teammates
Hi xerox, will it compatible with adrenaline powerup plugin?
|
Re: [L4D2] Inject Adrenaline to your Teammates
After checking the source of the mentioned Plugin and Left 4 DHooks Direct it should work in theory. I haven't tested it.
|
Re: [L4D2] Inject Adrenaline to your Teammates
i love this idea,players always save that pills even floor has more,can you add support pills?
and i think injecting should stop teammate and self |
All times are GMT -4. The time now is 04:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.