Feel free to suggest features.
This is a simplistic plugin that allows Heavies to throw out trapped versions of Sandviches that heal less, but deal damage to the opposing team.
They will deal the same amount of damage as they would've healed.
Unfortunately, this damage will cut-off if it's more than the maximum amount of health, just like a normal small health-pack.
(A Heavy with 299 health picks up a trapped sandvich; he only loses 1 HP instead of 60 HP.)
(A Scout with 115 health picks up a trapped sandvich; he only loses 10 HP instead of 25 HP.)
The above feature is now cut and replaced entirely with
sm_trapped_sandvich_damage.
The trapped Sandviches can also only be picked up if the victim has less-than-max health.
-= How to Use =-
1. Take out your sandvich.
2. Press and hold the RELOAD key.
3. Throw the sandvich by pressing MOUSE2.
-= Further Info =-
- When a player changes class to Heavy, they'll be informed with a hint text.
- A difference between a normal Sandvich and it's trapped version is the normal one floats higher off the ground, whilst the trapped version looks more as if laid down on the ground.
-= ConVars =-
sm_trapped_sandvich_enable {1.0} [0.0/1.0] =
Allow Heavies to throw trapped sandviches by holding RELOAD while throwing a Sandvich.
sm_trapped_sandvich_damage {50.0} [0.0/INF] =
Damage to deal to victims of trapped sandviches.
sm_trapped_sandvich_notify_classchange {1.0} [0.0/1.0] =
Notify players that change to Heavy about how to throw trapped sandviches?
sm_trapped_sandvich_notify_death {1.0} [0.0/1.0] =
Notify players when they ate a trapped sandvich which caused them to die?
-= Releases =-
Code:
Version 1.0.3c
- Timers with entities now use the entity references instead of indexes to prevent affecting the wrong entities.
Version 1.0.3b
- Timers now use UserIds to prevent affecting the wrong clients.
Version 1.0.3
- Fixed issue with sandvich healing instead of damaging enemies if sm_trapped_sandvich_damage was set to 0.
- Replaced StrContain with strncmp.
Version 1.0.2
- Fixed errors with invalid entities.
- Replaced using the amount healed by packs as damage, now fully uses sm_trapped_sandvich_damage for damage.
Version 1.0.1
- Now compiles with SM 1.11.
- Optimized ConVar-grabbing code with Silvers' AddChangeHooks method.
- Optimized chars with static to prevent null string bottlenecks.
Version 1.0.0
- Initial release.
-= How to Install (IMPORTANT) =-
- Move the
.phrases.txt file to your
translations folder inside the Sourcemod directory.
- Move the
.smx file to your
plugins folder inside the Sourcemod directory.
If you get errors about missing phrases, make sure to get the latest version of the trapped_sandvich.phrases.txt file.