AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Automatic Grenade Giver (https://forums.alliedmods.net/showthread.php?t=156444)

winds 05-06-2011 15:12

Automatic Grenade Giver
 
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!

ConnorMcLeod 05-06-2011 16:17

Re: Automatic Grenade Giver
 
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)     } }

ErrorStereotype 05-06-2011 18:11

Re: Automatic Grenade Giver
 
Quote:

Originally Posted by ConnorMcLeod (Post 1464598)
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 2)


:D fail


Quote:

cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 2)
:arrow:

Quote:

cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1)

winds 05-07-2011 18:34

Re: Automatic Grenade Giver
 
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 :P
About to test it now

Da_maniaC 07-31-2011 05:52

Re: Automatic Grenade Giver
 
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).

SnoW 07-31-2011 06:58

Re: Automatic Grenade Giver
 
^
Code:
give_item( id, "weapon_hegrenade" );

Da_maniaC 07-31-2011 07:00

Re: Automatic Grenade Giver
 
Thanks, but does that give a grenade when the previous one has been detonated, or? :)

ConnorMcLeod 07-31-2011 07:48

Re: Automatic Grenade Giver
 
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")
    }



Da_maniaC 07-31-2011 09:10

Re: Automatic Grenade Giver
 
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? :)


All times are GMT -4. The time now is 14:17.

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