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

Automatic Grenade Giver


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
winds
Member
Join Date: Aug 2010
Old 05-06-2011 , 15:12   Automatic Grenade Giver
Reply With Quote #1

Hey guys,
I have tried a few approved plugins on here (ex. Nade Giver) but they don't seem to work how I want them to.

I was hoping someone could make a simple plugin that gives all players at the start of every round 1 he grenade, 2 flash bangs, and 1 smoke grenade. Also if a player survives a round and doesn't use his grenades, can the plugin check to see if they still have their nades and only give them the appropriate ones so they always have a maximum of 1 he, 2 flash, 1 smoke at the beginning of each round.

I am having a problem with people spamming he grenades in my assault server so I want to restrict the buying of all grenades and just give them the max amount allowed. The nade giver plugin accomplishes this but unfortunately it gives them 1 he, 2 flash, 1 smoke even if they already have these grenades. They accumulate.

I've also tried plugins to stop the buying of more than 1 he grenade but they don't block the re-buy commands so that didn't work either.

Thanks guys!
winds is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-06-2011 , 16:17   Re: Automatic Grenade Giver
Reply With Quote #2

Code:
#include <amxmodx> #include <hamsandwich> #include <fun> #include <cstrike> #define VERSION "0.0.1" #define PLUGIN "Nade Giver" public plugin_init() {     register_plugin(PLUGIN, VERSION, "ConnorMcLeod")     RegisterHam(Ham_Spawn, "player", "CBasePlayer_Spawn_Post", true) } public CBasePlayer_Spawn_Post( id ) {     if( is_user_alive(id) )     {         give_item(id, "weapon_hegrenade")         give_item(id, "weapon_flashbang")         give_item(id, "weapon_smokegrenade")         cs_set_user_bpammo(id, CSW_HEGRENADE, 1)         cs_set_user_bpammo(id, CSW_FLASHBANG, 2)         cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1)     } }
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-07-2011 at 03:15.
ConnorMcLeod is offline
ErrorStereotype
Senior Member
Join Date: Feb 2011
Location: Bosnia and Herzegovina
Old 05-06-2011 , 18:11   Re: Automatic Grenade Giver
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 2)

fail


Quote:
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 2)


Quote:
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1)

Last edited by ErrorStereotype; 05-06-2011 at 18:14.
ErrorStereotype is offline
winds
Member
Join Date: Aug 2010
Old 05-07-2011 , 18:34   Re: Automatic Grenade Giver
Reply With Quote #4

Thanks guys,
However when I installed this in my server it says "bad load" instead of "running".
Any idea what happened?
Thanks!

*EDIT* Nevermind, I put the sma instead of the amxx into the plugins folder...fail
About to test it now
winds is offline
Da_maniaC
Junior Member
Join Date: Jul 2011
Old 07-31-2011 , 05:52   Re: Automatic Grenade Giver
Reply With Quote #5

Hi all,

I am actually looking for a way to give a player a new grenade once he has detonated his previous one.
Does annyone know if this is possible? (I do not know what kind of plugins/scripts i would need since i am new to all this).
Da_maniaC is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 07-31-2011 , 06:58   Re: Automatic Grenade Giver
Reply With Quote #6

^
Code:
give_item( id, "weapon_hegrenade" );
SnoW is offline
Send a message via MSN to SnoW
Da_maniaC
Junior Member
Join Date: Jul 2011
Old 07-31-2011 , 07:00   Re: Automatic Grenade Giver
Reply With Quote #7

Thanks, but does that give a grenade when the previous one has been detonated, or?
Da_maniaC is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-31-2011 , 07:48   Re: Automatic Grenade Giver
Reply With Quote #8

Try this :

PHP Code:
#include <amxmodx>
#include <fun>

public plugin_init()
{
    
register_plugin("auto HE""0.0.1""ConnorMcLeod")
    
register_event("SendAudio""Event_SendAudio_FITH""be""2=%!MRAD_FIREINHOLE")
}

public 
Event_SendAudio_FITHid )
{
    if( 
read_data(1) == id && is_user_alive(id) && get_user_weapon(id) == CSW_HEGRENADE )
    {
        
give_item(id"weapon_hegrenade")
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Da_maniaC
Junior Member
Join Date: Jul 2011
Old 07-31-2011 , 09:10   Re: Automatic Grenade Giver
Reply With Quote #9

Thanks a lot for your help!
1. Will this trigger when the player says "Fire in the hole" (upon throwing the nade) ?
If so, would it be possible to add a delay of n Seconds, because else it will turn into a grenade spamfest.
2. As i mentioned earlier i am a total noob when it comes to scripts like this.
How would i actually run or install this onto my server?
Da_maniaC 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 13:06.


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