AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   DoD NoNades - Disable grenades (https://forums.alliedmods.net/showthread.php?t=72271)

Vet 06-03-2008 22:33

DoD NoNades - Disable grenades
 
2 Attachment(s)
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.
.

Xanimos 06-18-2008 01:57

Re: DOD NoNades - Disable grenades
 
Please set the mod to DOD.
Other than that, once you get some positive feedback it can be approved.

Vet 06-18-2008 09:00

Re: DOD NoNades - Disable grenades
 
Done.

diamond-optic 06-18-2008 19:50

Re: DOD NoNades - Disable grenades
 
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 06-20-2008 21:56

Re: DOD NoNades - Disable grenades
 
just a minor typo in the cmdNN_On function:
PHP Code:

log_amx("NoNades: Admin %s Disablad grenades"arg2


Vet 06-20-2008 22:46

Re: DOD NoNades - Disable grenades
 
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!

diamond-optic 07-02-2008 15:41

Re: DOD NoNades - Disable grenades
 
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 :)

Vet 07-02-2008 23:08

Re: DOD NoNades - Disable grenades
 
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)?

diamond-optic 07-06-2008 02:26

Re: DOD NoNades - Disable grenades
 
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

Vet 07-07-2008 00:51

Re: DOD NoNades - Disable grenades
 
Quote:

Originally Posted by diamond-optic (Post 640749)
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.


All times are GMT -4. The time now is 20:48.

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