Raised This Month: $12 Target: $400
 3% 

[REQ] HEGrenade Give with optional rate/delay?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Da_maniaC
Junior Member
Join Date: Jul 2011
Old 11-12-2011 , 19:08   [REQ] HEGrenade Give with optional rate/delay?
Reply With Quote #1

Hi there,

I am looking for a plugin/script that will give players 1 HEGrenade when they spawn. Then if they use it they will get a new grenade after 'n' amount of time.

I have tried a few "Unilimited HEgrenades/Grenades" plugins/scripts but those either hit you with 999 grenades instantly, or don't have a delay that can be customised.

I also found this when i searched these forums, but if i try to compile it I get error messages.

Any help would be appreciated!
Da_maniaC is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 11-13-2011 , 00:01   Re: [REQ] HEGrenade Give with optional rate/delay?
Reply With Quote #2

I can hook you up with something. Did you want them to get another nade after X seconds of detonation of the one they're given at spawn?
TnTSCS is offline
Da_maniaC
Junior Member
Join Date: Jul 2011
Old 11-13-2011 , 10:56   Re: [REQ] HEGrenade Give with optional rate/delay?
Reply With Quote #3

Hi there,

Thanks for the reply.
What im looking for:

- Players get 1 hegrenade when they spawn.
- When they throw it, they will not get another grenade until 'x' number of seconds have passed since they threw it.

I would like the time to be configurable, because i want to go try and see what will work best (in essence i want players to have continuous grenades, but if they get one too quickly they can start spamming them...which is what i want to avoid).

Last edited by Da_maniaC; 11-13-2011 at 10:57.
Da_maniaC is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 11-13-2011 , 11:16   Re: [REQ] HEGrenade Give with optional rate/delay?
Reply With Quote #4

okay... I'll code this right quick - off for a run, then I'll code it
TnTSCS is offline
Da_maniaC
Junior Member
Join Date: Jul 2011
Old 11-13-2011 , 13:06   Re: [REQ] HEGrenade Give with optional rate/delay?
Reply With Quote #5

Awesome man, thanks.
Da_maniaC is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 11-13-2011 , 13:11   Re: [REQ] HEGrenade Give with optional rate/delay?
Reply With Quote #6

Okay... done :)

A little more involved than I first though. And I made it a little VIP-ish if you care to use it.

Only players with CUSTOM1 flag will be given an hegrenade at spawn. You can override this to include any player by adding the following into your admin_overrides.cfg:

"give_unlimitedhe_allow" ""
or if you want only those with CUSTOM4 it would be:
"give_unlimitedhe_allow" "r"

There's also an admin command you can use to toggle this plugin on or off (admin flag is set to generic, but you can override this in admin_overrides.cfg):
sm_unlimitedhe
Usage: sm_unlimitedhe <1/0>
1=ON, 0=OFF

A config file will be created in your cstrike/cfg/sourcemod called UnlimtedHE.plugin.cfg. In that file you can set your variables:

sm_unlimitedhe_delay
"sm_unlimitedhe_delay" = "15" ( def. "15" ) min. 0.100000 max. 300.000000
- Number of seconds to wait after HE detonation to give player a new hegrenade

sm_unlimitedhe_enabled
"sm_unlimitedhe_enabled" = "1" min. 0.000000 max. 1.000000
- 1=enabled, 0=disabled


-----------
reuploaded .sp due to spelling error in command reply
Attached Files
File Type: sp Get Plugin or Get Source (UnlimitedHE.sp - 282 views - 6.6 KB)

Last edited by TnTSCS; 11-13-2011 at 13:14.
TnTSCS is offline
Da_maniaC
Junior Member
Join Date: Jul 2011
Old 11-13-2011 , 18:35   Re: [REQ] HEGrenade Give with optional rate/delay?
Reply With Quote #7

Hey,

Thanks a lot for all your help man!

I put the .smx file in cstrike/addons/sourcemod/plugins and the cfg file was generated.
I put in these settings (to test):
Code:
// This file was auto-generated by SourceMod (v1.4.0)
// ConVars for plugin "UnlimitedHE.smx"


// Number of seconds to wait after HE detonation to give player a new hegrenade
// -
// Default: "15"
// Minimum: "0.100000"
// Maximum: "300.000000"
sm_unlimitedhe_delay "1"

// 1=enabled, 0=disabled
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
sm_unlimitedhe_enabled "1"

// The version of 'Unlimited HE'
// -
// Default: "1.0.0"
sm_unlimitedhe_version "1.0.0"

// The version of SourceMod that 'Unlimited HE' was compiled with.
// -
// Default: "1.4.1-dev"
sm_unlimitedhe_version_build "1.4.1-dev"
My admin_overrides.cfg looks like this:
Code:
Overrides
{
	/**
	 * By default, commands are registered with three pieces of information:
	 * 1)Command Name 		(for example, "csdm_enable")
	 * 2)Command Group Name	(for example, "CSDM")
	 * 3)Command Level		(for example, "changemap")
	 *
	 * You can override the default flags assigned to individual commands or command groups in this way.
	 * To override a group, use the "@" character before the name.  Example:
	 * Examples:
	 *		"@CSDM"			"b"				// Override the CSDM group to 'b' flag
	 * 		"csdm_enable"	"bgi"			// Override the csdm_enable command to 'bgi' flags
	 *
	 * Note that for overrides, order is important.  In the above example, csdm_enable overwrites
	 * any setting that csdm_enable previously had.
	 *
	 * You can make a command completely public by using an empty flag string.
	 */
}

"give_unlimitedhe_allow" ""
Right now, the mod seems to be running...but i am not getting a new grenade automatically.



Am i doing something wrong?

Last edited by Da_maniaC; 11-13-2011 at 18:37.
Da_maniaC is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 11-13-2011 , 20:04   Re: [REQ] HEGrenade Give with optional rate/delay?
Reply With Quote #8

yes... put the "give_unlimitedhe_allow" "" in the {}'s

Code:
Overrides
{
	/**
	 * By default, commands are registered with three pieces of information:
	 * 1)Command Name 		(for example, "csdm_enable")
	 * 2)Command Group Name	(for example, "CSDM")
	 * 3)Command Level		(for example, "changemap")
	 *
	 * You can override the default flags assigned to individual commands or command groups in this way.
	 * To override a group, use the "@" character before the name.  Example:
	 * Examples:
	 *		"@CSDM"			"b"				// Override the CSDM group to 'b' flag
	 * 		"csdm_enable"	"bgi"			// Override the csdm_enable command to 'bgi' flags
	 *
	 * Note that for overrides, order is important.  In the above example, csdm_enable overwrites
	 * any setting that csdm_enable previously had.
	 *
	 * You can make a command completely public by using an empty flag string.
	 */
"give_unlimitedhe_allow" ""
}
Let me know if that fixes things. You should get a new grenade 1 second after one that you throw detonates though... you just wouldn't get one at spawn until you fix the above

Last edited by TnTSCS; 11-13-2011 at 20:06.
TnTSCS is offline
Da_maniaC
Junior Member
Join Date: Jul 2011
Old 11-14-2011 , 17:25   Re: [REQ] HEGrenade Give with optional rate/delay?
Reply With Quote #9

The script is working, thanks a lot!

But earlier on there seemed to be something wrong with the way bots we're picking up grenades in their inventory (they would just drop on the ground): Click.
I changed the cssdm.cfg to make no one start out with a grenade in the inventory.
At first, after a restart it didn't seem to make a different but now it seems to be fine...
Da_maniaC is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 11-14-2011 , 19:05   Re: [REQ] HEGrenade Give with optional rate/delay?
Reply With Quote #10

ya... since cssdm gives you the option to give everyone a grenade at spawn, and my plugin allows that as well, each person could potentially be given two grenades and if you don't allow more than 1 grenade, they'll just drop the second one.

Either disable the cssdm part, or I could add to this plugin by putting a variable to enable giving a nade at spawn...

either way will work.
TnTSCS is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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