PDA

View Full Version : DoD DropGrenades (v0.8)


FeuerSturm
06-30-2007, 01:21 PM
//
// DESCRIPTION:
// ============
//
// - players drop exactly the grenades they have left on
// death and alive players can pickup those
// (example: Axis player dies and drops a stickgrenade
// -> Allied player picked it up while still having a handgrenade
// -> Allies player dies and drops 1x Stick- and 1x Handgrenade
// -> A player that has no grenades picks up both and will drop
// both on death as well)
// - grenades will be removed once a round is finished
// - additionally each player's previously dropped grenade(s) can be removed
// before dropping new ones.
//

//
// USAGE:
// ======
//
// CVARS:
//
// dod_dropgrenades_enabled <1/0> = enable/disable DoD DropGrenades
// 1 = enabled
// 0 = disabled
//
// dod_dropgrenades_removeold <1/0> = enable/disable removing player's
// previously dropped grenade(s) before
// dropping new ones
// 1 = enabled
// 0 = all grenades stay until roundend
//
// dod_dropgrenades_ignorebots <1/0> = enable/disable ignoring bots
// 1 = ignore bots (bots don't drop or pickup grenades)
// 0 = don't ignore bots (bots drop and pickup grenades)
//
//
// ADMIN COMMAND:
//
// amx_dropgrenades <1/0> = enable/disable DoD DropGrenades
// 1 = enable
// 0 = disable and remove all dropped grenades
//

//
// CHANGELOG:
// ==========
//
// - 26.07.2005 Version 0.5beta
// Initial Public Release
//
// - 21.08.2005 Version 0.5beta2
// workaround:
// - added a fix for strange behavior on AMXX 1.50beta
//
// - 27.08.2005 Version 0.6beta
// changes:
// - removed workaround for AMXX 1.50beta as the bug is
// fixed in AMXX 1.55 which everyone should rather use
// than 1.50beta!
//
// - 12.01.2007 Version 0.6
// changes:
// - made it so that whatever side you are it will pickup your type of nades
// this is to make it compatiable with zors smoke nades plugin
// - added cvar to change amount of grenades allowed to have
//
// - 30.06.2007 Version 0.7
// - discarded changes from v0.6
// - changed Engine- to Fakemeta-Module for better performance
// - removed need for DoDFun module
// - changed to using pcvars
// - added full Linux compatibility with removing dod_get_user_ammo
// and counting players' grendades depending on their class after spawning
// - using grenade_throw forward to decrease amount of dropable grenades
// when a player throws a grenade.
// - players now drop exactly the grenades they have left on
// death and alive players can pickup those
// (example: Axis player dies and drops a stickgrenade
// -> Allied player picked it up while still having a handgrenade
// -> Allies player dies and drops 1x Stick- and 1x Handgrenade
// -> A player that has no grenades picks up both and will drop
// both on death as well)
// - removed all effects and ability to use an AmmoBox-Model instead of the
// grenade models for dropped grenades for more realism
// - added cvar dod_dropgrenades_ignorebots with that bots can be prevented
// from dropping and picking up grenades
//
// - 30.06.2007 Version 0.75
// - added ability to adjust the amount of grenades a player has by default
// NOTE: if you are not using any plugins that mess with the
// amount of grenades per player, keep the default value!
// - added ability to adjust the amount of grenades a player can pickup
// from the ground
// NOTE: if you are not using any plugins that mess with the
// amount of grenades per player, keep the default value!
// - added ability to adjust the amount of grenades that will be dropped
// when a player dies
// NOTE: if you are not using any plugins that mess with the
// amount of grenades per player, keep the default value!
//
// - 02.07.2007 Version 0.8
// - added roundstate "Draw" to clean up of dropped grenades
// - added global tracking cvar
//



PLEASE NOTE:
From now on this Plugin is considered a realism Plugin, if you
wish to have funny effects or different models for the dropped
grenades, please use "DoD DropGrenades 2 (http://dodplugins.net/forums/showthread.php?t=739)" modded by "Wilson [29th ID]".
It contains a lot more features other than the basic realism features.
If you like realism though, DropGrenades v0.7 is the right one for you!


PLEASE NOTE #2:
If you are running a Plugin that messes with or just changes the DoD default
amount of grenades that a specific player class has, you can adjust
DoD DropGrenades to fit to the changed amounts with editing the source code
(dod_dropgrenades.sma) with your text editor before compiling!
Look for the following lines:

// PLEASE ONLY CHANGE THE FOLLOWING NUMBERS THAT DECLARE THE
// NUMBER OF GRENADES EACH GROUP OF CLASSES HAVE IF YOU ARE
// USING A PLUGIN THAT CHANGES THE STANDARD AMOUNT OF GRENADES!

#define DOD_RIFLE_CLASSES 2 // GARAND, CARBINE, ENFIELD, K98, K43
#define DOD_MP_CLASSES 1 // THOMPSON, BAR, GREASEGUN, BREN, STEN, MP40, STG44, FG42, SCOPED FG42
#define DOD_SNIPER_CLASSES 0 // SPRINGFIELD, SCOPED ENFIELD, SCOPED K98
#define DOD_MG_CLASSES 0 // 30CAL, MG34, MG42
#define DOD_ROCKET_CLASSES 0 // BAZOOKA, PIAT, PANZERSCHRECK


// THE FOLLOWING IS THE MAX AMOUNT OF GRENADES A PLAYER CAN
// PICKUP! ADJUST THIS VALUE CAREFULLY!

#define DOD_GRENADES_PICKUP 2


// THE FOLLOWING IS THE MAX AMOUNT OF GRENADES THAT WILL BE DROPPED
// WHEN A PLAYER DIES THAT HAD MORE THAN THE DOD STANDARD LIMIT!
// TO PREVENT GRENADE-SPAMMING DEFAULT VALUE IS HIGHLY RECOMMENDED!

#define DOD_DROPGRENADES_MAX 2


IF NO OTHER PLUGIN MESSES WITH PLAYER'S GRENADES YOU
CAN LEAVE THE SOURCE CODE UNTOUCHED!


Now enjoy playing with a bit more realism! :D

{SR} *Raggy*
06-30-2007, 01:24 PM
I've got to try this out :D I was waiting for a newer one(I tried Wilson's one but it didn't work... Hopefully this will work :)) Thank you :D

FeuerSturm
06-30-2007, 01:50 PM
I've got to try this out :D I was waiting for a newer one(I tried Wilson's one but it didn't work... Hopefully this will work :)) Thank you :D

You're welcome! The only thing causing the old version and
Wilson's version to not work is "dod_set_user_ammo" which i buggy and
even worse on Linux, my Version 0.7 isn't using that buggy native
and i tested it successfully on windows AND linux. :cool:

{SR} *Raggy*
06-30-2007, 06:00 PM
Works perfectly :D I'm guessing that it's supposed to only let you pick up 1 nade from a persons lost nades... That's the only thing I noticed on this but it's brilliant anywayz without the whole picking up all the nades :P

diamond-optic
06-30-2007, 07:24 PM
one thing with the way your counting nades now is.. what about servers running plugins that give extra nades or such to classes? like giving a nade to rocket classes for example.. this wouldnt know they have one..

FeuerSturm
06-30-2007, 07:34 PM
one thing with the way your counting nades now is.. what about servers running plugins that give extra nades or such to classes? like giving a nade to rocket classes for example.. this wouldnt know they have one..

yes, that's correct, i'll add some defines for the classes, so people
can adjust the settings to their needs, not a big deal though ;)

Works perfectly :D I'm guessing that it's supposed to only let you pick up 1 nade from a persons lost nades... That's the only thing I noticed on this but it's brilliant anywayz without the whole picking up all the nades :P

you should get both dropped grenades if you don't have any, if you still
have 1 left, you will only get 1 of 2 from the ground.
if that's not the case, please let me know!

{SR} *Raggy*
06-30-2007, 07:56 PM
I'll try it again... I did have one grenade but I'll check if I can pick up the 2 of them

Perfect I can pick up 2 that are on the ground from the previous person that had them :) Thank you again :D

FeuerSturm
06-30-2007, 09:12 PM
//
// - 30.06.2007 Version 0.75
// - added ability to adjust the amount of grenades a player has by default
// NOTE: if you are not using any plugins that mess with the
// amount of grenades per player, keep the default value!
// - added ability to adjust the amount of grenades a player can pickup
// from the ground
// NOTE: if you are not using any plugins that mess with the
// amount of grenades per player, keep the default value!
// - added ability to adjust the amount of grenades that will be dropped
// when a player dies
// NOTE: if you are not using any plugins that mess with the
// amount of grenades per player, keep the default value!
//

PLEASE NOTE:
If you are running a Plugin that messes with or just changes the DoD default
amount of grenades that a specific player class has, you can adjust
DoD DropGrenades to fit to the changed amounts with editing the source code
(dod_dropgrenades.sma) with your text editor before compiling!
Look for the following lines:

// PLEASE ONLY CHANGE THE FOLLOWING NUMBERS THAT DECLARE THE
// NUMBER OF GRENADES EACH GROUP OF CLASSES HAVE IF YOU ARE
// USING A PLUGIN THAT CHANGES THE STANDARD AMOUNT OF GRENADES!

#define DOD_RIFLE_CLASSES 2 // GARAND, CARBINE, ENFIELD, K98, K43
#define DOD_MP_CLASSES 1 // THOMPSON, BAR, GREASEGUN, BREN, STEN, MP40, STG44, FG42, SCOPED FG42
#define DOD_SNIPER_CLASSES 0 // SPRINGFIELD, SCOPED ENFIELD, SCOPED K98
#define DOD_MG_CLASSES 0 // 30CAL, MG34, MG42
#define DOD_ROCKET_CLASSES 0 // BAZOOKA, PIAT, PANZERSCHRECK


// THE FOLLOWING IS THE MAX AMOUNT OF GRENADES A PLAYER CAN
// PICKUP! ADJUST THIS VALUE CAREFULLY!

#define DOD_GRENADES_PICKUP 2


// THE FOLLOWING IS THE MAX AMOUNT OF GRENADES THAT WILL BE DROPPED
// WHEN A PLAYER DIES THAT HAD MORE THAN THE DOD STANDARD LIMIT!
// TO PREVENT GRENADE-SPAMMING DEFAULT VALUE IS HIGHLY RECOMMENDED!

#define DOD_DROPGRENADES_MAX 2


IF NO OTHER PLUGIN MESSES WITH PLAYER'S GRENADES YOU
CAN LEAVE THE SOURCE CODE UNTOUCHED!

FeuerSturm
07-02-2007, 06:04 PM
//
// - 02.07.2007 Version 0.8
// - added roundstate "Draw" to clean up of dropped grenades
// - added global tracking cvar
//

As always, please report bugs with the new version immediately!

Enjoy!

Eden_Fire
01-19-2009, 07:51 PM
Hey FeuerSturm,

I'm running the plugin...the nades drop but are unable to be picked up by anyone. All plugins set to default...no other plugins concerning weapon mods/grenade mods are running or active. Thoughts?

Dr.G
01-19-2009, 07:59 PM
FeuerSturm isnt here much anymore unfortunately... however i dont use this version but one by Vet.. You can find it at allied modders...