This is refactored code of original work by panxiaohai + manually added some features from Marttt's fork, aimed to make it as fast (performance optimized) and crash-safe as possible.
Contains some features, which not exist in above fork.
Same vice versa, doesn't contain some feature you can find in Marttt fork.
Read ChangeLog for details.
/**
* Called whenever player put the witch on the ground.
*
* @param iClient Client index who put the witch
* @param iWitch Witch prop.
* @param fVec[3] Witch coordinates
*
* @noreturn
*/
forward void OnWitchGuard_PutGround(int iClient, int iWitch, float fVec[3]);
/**
* Called whenever player took the witch guard from the ground.
*
* @param iClient Client index
* @param iWitch Witch prop.
* @param fVec[3] Witch coordinates
*
* @noreturn
*/
forward void OnWitchGuard_RemoveGround(int iClient, int iWitch, float fVec[3]);
// Give witch to a random player if the killer already has one. 0 = Disable, 1 = Enable.
l4d_witch_guard_give_random "0"
// Show witch on back when some third-person actions happen? 0 = Disable (can increase performance), 1 = Enable.
l4d_witch_guard_detect_thirdperson "1"
// Enable this plugin? 0 = No, 1 = Yes.
l4d_witch_guard_enable "1"
// Weapon type given to the witch. 0 = Random, 1 = Assault Rifle, 2 = Hunting Rifle, 3 = Auto Shotgun.
l4d_witch_guard_weapon_type "0"
Supported games:
- L4D1
- L4D2
Warning: Don't forget to remove the old plugin witch_guard_l4d.smx, if you update (he has different name!)
ChangeLog
1.4.10-B (05-Aug-2022)
- Added preserving of witch color.
- Fixed compilation warnings on SM 1.11
1.4.7-B (21-Mar-2020)
- Code is beautified.
- Optimizations.
- Fixed anim timer doesn't stop in some cases and target wrong entities.
- Cached ConVar values.
- Some protections against crash.
- Added ConVar: "l4d_witch_guard_detect_thirdperson" - Show witch on back when some third-person actions happen? 0 = Disable (can increase performance), 1 = Enable.
- Added ConVar: "l4d_witch_guard_enable" - Enable this plugin? 0 = No, 1 = Yes.
- Added safe unloading.
Included Marttt changes from 1.4.9.4:
- Button for pickup the witch is now added through a timer 1.5 seconds later.
Included Marttt changes from 1.4.9.5:
- l4d_witch_guard_bestpose_onback ? 0: random pose, 1: best pose, 2: specific pose (uses pose_onback cvars)
- l4d_witch_guard_bestpose_ondown ? 0: random pose, 1: best pose, 2: specific pose (uses pose_down cvars)
- l4d_witch_guard_pose_down ? 0: off, 1-82: default witch pose while down. (l4d_witch_guard_bestpose_onback must be: 2)
- l4d_witch_guard_pose_onback ? 0: off, 1-82: default witch pose while on back. (l4d_witch_guard_bestpose_onback must be: 2)
1.4.6-B
- code clear, performance, safety and translation optimizations.
- added support for custom witch models.
- fixed conflict with CPR plugin (Ctrl + E is no more trigger witch guard).
- restored L4D1 support.
- @panxiaohai - original author
- @Marttt - for amazing additions in his fork
- @Lux - for third person detection plugin.
- @Mr. GameOver - for third person detection (in L4D1).
Donate
Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
- Patreon
- BitCoin
- Ю.Money
1.Does it have guardians to kill infected and damage to tanks goes to the owner?
2.Can each person limit the number of guardians
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1: