AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D] Pills Addiction 1.6.9 (now compatible with KrX upgrades) (https://forums.alliedmods.net/showthread.php?t=99688)

olj 08-08-2009 11:27

[L4D] Pills Addiction 1.6.9 (now compatible with KrX upgrades)
 
3 Attachment(s)
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

Dragonshadow 08-08-2009 11:51

Re: [L4D] Pills Addiction 1.0
 
This could be cool, they do chug the ENTIRE bottle...

Whosat 08-08-2009 12:38

Re: [L4D] Pills Addiction 1.0
 
Quote:

Originally Posted by Dragonshadow (Post 893470)
This could be cool, they do chug the ENTIRE bottle...

Who cares? They're in a frikin zombie war! :mrgreen:

But yeah its quite a good idea actually :)

GM-Scorp 08-08-2009 12:43

Re: [L4D] Pills Addiction 1.0
 
Wel when people on my server take it it stops after 20 sec or so

but when i take the pills
it says it wore of but it keeps going i have to take it down manualy

is that because i'm a admin and i have control over the drug toggle ?

teddyruxpin 08-08-2009 13:28

Re: [L4D] Pills Addiction 1.0
 
Could be more fun if you made them addicts who had to find pills or they go ape shit and die ;)

olj 08-08-2009 16:47

Re: [L4D] Pills Addiction 1.0
 
LOL

olj 08-08-2009 16:51

Re: [L4D] Pills Addiction 1.0
 
Quote:

Originally Posted by GM-Scorp (Post 893505)
Wel when people on my server take it it stops after 20 sec or so

but when i take the pills
it says it wore of but it keeps going i have to take it down manualy

is that because i'm a admin and i have control over the drug toggle ?

Was it DEDICATED? Or local host?

GM-Scorp 08-08-2009 17:52

Re: [L4D] Pills Addiction 1.0
 
DEDICATED its a rented server

but it does that with al my admins
it only works good on the visitors on my server

GrossKopf 08-08-2009 18:35

Re: [L4D] Pills Addiction 1.0
 
I've got admin and it wears off after the 20 seconds.

I think it would be funnier if the laughing continued during the whole time they are drugged.

olj 08-08-2009 20:57

Re: [L4D] Pills Addiction 1.0
 
Quote:

Originally Posted by GrossKopf (Post 893788)

I think it would be funnier if the laughing continued during the whole time they are drugged.

Done :mrgreen: But need testing though, its first time i using timers, and they dont love me at all :shock:

Quote:

Originally Posted by GM-Scorp
DEDICATED its a rented server

but it does that with al my admins
it only works good on the visitors on my server

The only reason why this could happen is when you change your team from survivors to infected or spectators, while being drugged. I changed filter alittle and added extra variable to control that. Shouldnt happen again, unless there is other reason why admins on your server get permadrugged, and i cant even think what can cause this besides team changes (which is easy for admins because they can change their team WHENEVER they want).


All times are GMT -4. The time now is 15:44.

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