View Single Post
Plugin Info:     Modification:          Category:          Approver:   Zenith77 (33)
Nomexous
Member
Join Date: Oct 2007
Old 01-12-2008 , 01:57   Ultimate Grenade Control (Nomexous)
Reply With Quote #1

Ultimate Grenade Control (by Nomexous)

Updated to version 2.0

Allows an admin with ADMIN_SLAY level access to control what happens when grenades are used.

Access the settings menu with the console command "amx_grenade_control". It's not recommended that you alter the "grenade_*_mode" cvars via the console. New settings will be applied at the start of the next round. The admin can choose whether or not to alert players when the grenade settings change.

HE Grenades:
(0) Normal. Grenade acts as expected.
(1) HE will vanish when thrown.
(2) HE will not explode, no matter how long you wait.
(3) HE will explode only when it's not possible to damage other players.
(4) HE will explode as soon as it can damage the thrower and no one else.
(5) HE will stick to the chest of the thrower and explode when no one else is in range.

Flashbangs:
(0) Normal.
(1) Flash will vanish when thrown.
(2) Flash won't go off, no matter how long you wait.
(3) Flash will go off only if it can't blind other players.
(4) Flash will go off only if it can blind the thrower and no one else.
(5) Flash will stick to the chest of the thrower and go off only when no one else can be blinded by it.

Smoke grenades:
(0) Normal.
(1) Vanish.
(2) No detonation.

This is a Fakemeta heavy plugin. There's lots of EngFunc_FindEntityInSphere and EngFunc_TraceLine, especially with the more severe grenade controls.

CVARS (all controllable through "amx_grenade_control" menu):

grenade_he_mode (0|1|2|3|4|5)
grenade_flash_mode (0|1|2|3|4|5)
grenade_smoke_mode (0|1|2)
grenade_announce_changes (0|1)
grenade_allow_teamnade (0|1)
grenade_allow_teamflash (0|1)

Feel free to suggest optimizations, new grenade modes, or other features.

The source code is heavily commented; check there if you need more information on grenade modes.

Versions:
[1.0]
- Initial release.
[2.0]
- Forward unregistered when all grenades are in normal mode.
- Removed colored announcement messages.
- Now determines grenade type by checking offset 114 instead of model.
- Option to allow team attack with grenades or team flash (only in modes other than normal).
- Grenade modes are now aware of friendly fire.
- Various optimizations.
Attached Files
File Type: sma Get Plugin or Get Source (u_gren_ctrl.sma - 4204 views - 17.3 KB)

Last edited by Nomexous; 01-18-2008 at 21:15.
Nomexous is offline