Raised This Month: $106 Target: $400
 26% 

DoD NoNades - Disable grenades


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Day of Defeat        Category:   Gameplay        Approver:   YamiKaitou (5)
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 06-03-2008 , 23:33   DoD NoNades - Disable grenades
Reply With Quote #1

DOD NoNades - for Day of Defeat 1.3

Description:
This plugin will allow admins to disable grenades in DOD on a map, team or player basis. It was inspired by a plugin request over at www.dodplugins.net. After writing a quickie plugin to disable grenades on a map basis, I decided to take the plugin further and allow admins to control grenades on a team and player basis as well. The grenade disable on a player can be set to honor or ignore immunity (default ON - obey immunity)

Disabling grenades by...
Map - To disable grenades on a map basis, you can create a dod_nonades.cfg file and place it in the amxmodx/config folder. In the file, just list the names of the maps you wish to disable grenades on. Or, as an alternative, you can enter the command dod_nonades_on in a map specific config file or simply enter it from the console. To re-enable grenades, use the command dod_nonades_off.

Team - To disable grenades on a team, use the command dod_nonades_team <0|1|2>. The number corresponds to the team you wish to disable grenades on. 1 = Allies, 2 = Axis (0 = Off, re-enable for both teams). This too, if desired, can be set in advance on a map basis. Just put the command in a map specific cfg file.

Player - To disable grenades on a player, enter dod_nonades_player <name|#userid> in console. This action has the option to obey player immunity by setting a CVar.

Usage note:
On all commands entered after the start of a map, the action won't take effect until the player respawns.

Commands: (access level ADMIN_CFG required)
dod_nonades_on - Disables grenades for all players
dod_nonades_off - Enables grenades for all players
dod_nonades_team <0|1|2> - Restrict team grenades setting - 0 = Off, 1 = Allies, 2 = Axis
dod_nonades_player <name|#userid> - Toggles grenades on player
dod_nonades_help - Displays NoNades Command Help
dod_nonades_status - Displays map, team and player grenade status (ADMIN_ALL)


CVars:
dod_nonades_immunity <0|1> - Obey admin immunity (default 1)

Notes:
- Any command can be entered in console at any time.
- The commands dod_nonades_on|off will override any previous settings.
- The team setting will override individual player settings.
- Use the command dod_nonades_status to display a list of what players/team are disabled.
- The map and team settings do NOT obey immunity.
- If a player/team has their grenades disabled, they are notified by a chat message.
- If grenades are disabled at the start of a round, players are notified by a HUD message
- The plugin does NOT prevent players from picking up other player's grenades.
.
Attached Files
File Type: sma Get Plugin or Get Source (dod_nonades.sma - 2139 views - 8.4 KB)
__________________
=====================================
- My Plugins -
=====================================

Last edited by Vet; 03-13-2009 at 00:41.
Vet is offline
Send a message via MSN to Vet
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 06-18-2008 , 02:57   Re: DOD NoNades - Disable grenades
Reply With Quote #2

Please set the mod to DOD.
Other than that, once you get some positive feedback it can be approved.
__________________
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 06-18-2008 , 10:00   Re: DOD NoNades - Disable grenades
Reply With Quote #3

Done.
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
diamond-optic
Veteran Member
Join Date: May 2005
Location: Upstate New York
Old 06-18-2008 , 20:50   Re: DOD NoNades - Disable grenades
Reply With Quote #4

works good! great for small maps where nade-spam becomes extremely annoying
only problem i ran into was with players getting nades after spawning..

2 examples:
-- on my server i give sniper/rocket classes a nade on spawn and they will still have these nades
-- picking up grenades laying around in the map will allow players to use them..

a very quick and simple fix i found for these was to just add this:
PHP Code:
register_event("CurWeapon","player_spawn","b","1=1","2=13","2=14"
to the plugin_init

other then that.. this is exactly what ive been looking for good job yet again vet!
__________________
diamond-optic is offline
Send a message via AIM to diamond-optic
diamond-optic
Veteran Member
Join Date: May 2005
Location: Upstate New York
Old 06-20-2008 , 22:56   Re: DOD NoNades - Disable grenades
Reply With Quote #5

just a minor typo in the cmdNN_On function:
PHP Code:
log_amx("NoNades: Admin %s Disablad grenades"arg2
__________________
diamond-optic is offline
Send a message via AIM to diamond-optic
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 06-20-2008 , 23:46   Re: DOD NoNades - Disable grenades
Reply With Quote #6

Ah, good catch. Fixed
As for the nades still being available by being picked up, I mentioned that in my notes. My intention was only to prevent the grenades on spawn. But since you found an easy fix for the situation, I think I'll include it as an option via CVar in my next revision. Thanks!
__________________
=====================================
- My Plugins -
=====================================

Last edited by Vet; 06-21-2008 at 00:48.
Vet is offline
Send a message via MSN to Vet
diamond-optic
Veteran Member
Join Date: May 2005
Location: Upstate New York
Old 07-02-2008 , 16:41   Re: DOD NoNades - Disable grenades
Reply With Quote #7

nothing major, but ive had a few invalid player errors on the get_user_team native on the spawn function..

like i said, its nothing major but its as simple as can be to fix so i figured id mention it
__________________
diamond-optic is offline
Send a message via AIM to diamond-optic
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 07-03-2008 , 00:08   Re: DOD NoNades - Disable grenades
Reply With Quote #8

Hmm, I've looked through my logs and didn't see anything. Just curious, were you using bots? And what mode were you in (all, team, player)?
__________________
=====================================
- My Plugins -
=====================================

Last edited by Vet; 07-03-2008 at 00:13.
Vet is offline
Send a message via MSN to Vet
diamond-optic
Veteran Member
Join Date: May 2005
Location: Upstate New York
Old 07-06-2008 , 03:26   Re: DOD NoNades - Disable grenades
Reply With Quote #9

there might have been bots at the times i got the errors. most likey thats the only thing that would leave fast enough after spawning to cause that

and its with nades turned off for both teams
__________________
diamond-optic is offline
Send a message via AIM to diamond-optic
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 07-07-2008 , 01:51   Re: DOD NoNades - Disable grenades
Reply With Quote #10

Quote:
Originally Posted by diamond-optic View Post
a very quick and simple fix i found for these was to just add this:
PHP Code:
register_event("CurWeapon","player_spawn","b","1=1","2=13","2=14"
to the plugin_init
I tried this out and discovered it didn't play nice with my dod_deathnades plugin. I'll check into it further and see what pops up.
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
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:32.


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