View Single Post
Author Message
olj
Veteran Member
Join Date: Jun 2009
Old 08-08-2009 , 11:27   [L4D] Pills Addiction 1.6.9 (now compatible with KrX upgrades)
Reply With Quote #1

This plugin for Left 4 Dead will make any pills user drugged for some time (configurable). Also vocalize Laugh on using (really fun imo). Added possibility to give pills at start and have adrenaline speed boost on overdose.

IMPORTANT: You will need KrX_surup.inc file if you want to compile 1.6.9 version on your machine. Grab attached smx if you dont want to compile yourself. Heres KrX Upgrades http://forums.alliedmods.net/showthread.php?t=100507

Config

It will create cfg file named l4d_pills_addiction.cfg in your left4dead\cfg\sourcemod folder.

CVARS

// How many pills can be used before user will die from overdose (0 to disable)
// -
// Default: "0"
l4d_pillsaddiction_death_threshold "0"

// How much time user will be drugged
// -
// Default: "20.00"
l4d_pillsaddiction_overdose_time "20.00"

// How many pills can be used before overdose will take place
// -
// Default: "1"
l4d_pillsaddiction_threshold "1"

// Version of Pills addiction plugin

l4d_pa_version

// 0 disabled, 1 only one-time laugh on taking pills, 2-laughing untill effects wears off
// -
// Default: "2"
// Minimum: "0.000000"
// Maximum: "2.000000"
l4d_pillsaddiction_vocalize_mode "2"

// If 1, only admins will get pills on round start.
// -
// Default: "0"
l4d_pillsaddiction_givepills_adminonly "0"

// Should we give pills at round start?
// -
// Default: "0"
l4d_pillsaddiction_givepills_enabled "0"

// If 1, you will get adrenaline speed boost while overdosed.
// -
// Default: "1"
l4d_pillsaddiction_adrenaline_boost_enabled "1"

// Speed factor of adrenaline boost, 1.0 means no changes, 2.0 means double speed. Use 0.x to decrease speed.
// -
// Default: "1.45"
l4d_pillsaddiction_adrenaline_speedfactor "1.45"

// Time which will pass before giving pills at round start.
// -
// Default: "30.0"
l4d_pillsaddiction_givepills_timeout "30.0"

Commands

sm_killdrugs "Kills all drugs" (will remove all drug effects from all players), requires admin flag "kick".

Notes on mechanic

Hooks pills_used event and drugs user for certain amount of time (using timer to turn it off after "l4d_pillsaddiction_overdose_time" passed).

Credits
Zverina, for great idea!
Everyone on the alliedmods.net.
Valve for great game.

Things to do
Add CVAR to turn off/on "You have been overdosed" messages".
Add some more vocalize
Actually add an addiction system (if "x" not using pills after first dose for "y" time, he will suffer "z" effects or damage)
Some optimization

Changelog
08.08.2009 / initial release
09.08.2009 / 1.1 Addedversion cvar; added CVAR to control how much times one should use pills before he will be drugged; added repeateble laugh untill overdose effect wear off.
09.08.2009/ 1.2 Uses MaxClients instead of GetMAxClients(), uses UserID's instead of names (thanx to Whosat for tip), changed filters order (IsClientInGame checked first now).
10.08.2009/ 1.3 Added IsClientConnected and IsPlayer alive checks in code, added CVAR to control Deadly Dose (with scream vocalize), added CVAR to control laughin', changed for statements to check clients from 1, instead from 0.
11.08.2009/ Added TEST VERSION W/OUT ServerCommand (included code from drug.sp instead), Test and feedback plz; Dont use sm_drug with this.
11.08.2009/ 1.4 Changed code so it doesnt need to ServerExecute sm_drug anymore, thus, killing [SM] spam in chat area and hopefully killing all those bugs reported.
13.08.09/ 1.5 Added "sm_killdrugs" admin command to remove all drug effects from all players.
13.08.09/ 1.5.1 Valid clients checking optimization.
17.08.09/ 1.6 Added CVARS to enable/disable giving pills at round starts, added CVAR to give pills at start to admins only, added ChatAll message when someone died from overdose.
22.08.09/ 1.6.1 Use while waiting for 1.7. Counters now should reset at round ends, increased time before giving pills.
23.08.09/ 1.6.3 Use while waiting for 1.7. Added Adrenaline Boost while overdosed, speed factor and enabled/disabled controlled by cvars, minor color coding for "you ve been overdosed" message.
23.08.09/ 1.6.4 Fixed errors messages in console on round ends (due to lack of checks in resetting functions).
26.08.09/ 1.6.5 Added CVAR to control time before giving pills at round starts.
01.09.09/ 1.6.6 Moved GivePillsEnabled check to pillsgiving function. Works 100% now, if someone got problems with it.
01.09.09/ 1.6.7 Now dont require KrX upgrades to work. Can work without it. You still need KrX_surup.inc to compile though.
02.09.09/ 1.6.8 Rewrote compatibility code, now it will 100% without upgrades.
08.09.09/ 1.6.9 Hopefully fixed not-reverting to normal speed after overdose end if survivor dont have adrenaline upgrade.
1.7 BETA here http://forums.alliedmods.net/showpos...0&postcount=73

Downloads history:
1.5.1 - 186 views
1.6 - 148 views
1.6.1 - 38 views
1.6.3 - 27 views
1.6.4 - 58 views
1.6.5 - 113 views
1.6.9 -71 views
Attached Files
File Type: sp Get Plugin or Get Source (PillsAddiction1.5.1.sp - 4201 views - 8.4 KB)
File Type: sp Get Plugin or Get Source (PillsAddiction 1.6.9.sp - 2267 views - 16.0 KB)
File Type: smx PillsAddiction 1.6.9.smx (9.6 KB, 2978 views)
__________________

Last edited by olj; 09-12-2009 at 09:06.
olj is offline