View Single Post
Plugin Info:     Modification:          Category:          Approver:   Hawk552 (427)
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna know...
Old 02-03-2009 , 08:55   Instant Grenades Throwing [Version 1.5]
Reply With Quote #1

Instant Grenades Throwing
Version 1.5
by Dores
Tested on CS 1.6.


Description:


Allows a player to instantly throw grenades, if the weapon he is holding is not a grenade.
It will switch to the wanted grenade(if he has it) and will immediately, without a delay, throw it.
You can also throw different kinds of grenades one by another without a delay, like flashabangs.

Added new features:

1. Now there are 2 types of throwing(for changing types go to Commands):
  • Auto Throw - Automatically throws the grenade when nade_throw was sent.
  • Hold - Holds the grenade with the pin pulled and releases it when the player uses the command again.
2. Nade Choosing:
  • Each player toggles which grenade does he want to instantly throw by using a command(@ Commands).
  • No arguments for nade_throw. Just use the command, and it will throw the grenade you chose(unless you don't have it).
  • A small HUD sprite will be shown near the timer, that shows what grenade is the player using right now and changes according to the player's choice.
3. Added help MOTDs. Help is changed if Nade Choosing is enabled.

4. Added a sound and a notify text when choosing a grenade(in Nade Choosing).

5. Added Multi-Lingual support(help MOTDs are in English).

6. Changed the IsGrenade() stock to a define(thanks ConnorMcLeod).

7. Fixed where +attack remained when players switched weapons while holding the pin-pulled grenade.

8. Removed the round start hook and instead hooked player spawn using HamSandwich(included the HamSandwich module).

9. Nade Choosing can now be used whenever the players want without the need to enable it and re-compile the plugin. It's now considered as a built-in feature that may be used when wanted.

10. Fixed a "new line" HTML tag(<br />) in the help MOTDs.

11. Removed 2 lines from ML that can only be done in English.

12. Forgot changing 2 messages to ML.

13. Minor code improvements, thanks Hawk552.

14. Added auto grenade switch after throwing a grenade(only switches the grenade that will be thrown next time by using the "nade_throw" command).
Thanks Costin83 for the idea.

15. Forgot to include the updated .amxx file in the .zip file.

To instantly throw a grenade, players should bind keys to(don't use 'f'/'s'/'h' if you want to throw a chosen grenade):
  • nade_throw
    • f - Instantly throws flashbangs.
    • h - Instantly throws HE grenades.
    • s - Instantly throws smoke grenades.
Example: bind f "nade_throw h"(or to throw the chosen grenade: bind f "nade_throw").
Now with f I can instantly throw HE grenades/the chosen grenade.


CVars:
  • INT_on - Toggles the plugin.
  • INT_flash - [Dis]Allows flash from being instantly thrown.
  • INT_he - [Dis]Allows HE from being instantly thrown.
  • INT_smoke - [Dis]Allows smoke from being instantly thrown.
  • INT_icons - [Dis]Allows showing the chosen grenade's hud icon near the timer.
  • INT_auto_switch - [Dis]Allows auto switching the grenade that will be thrown next time by "nade_throw" after a grenade thrown. [Default: 1]
Commands:
  • nade_throw <nade> - The command that instantly throws a specific grenade(take a look at plugin description).
  • Note: Don't put anything instead of 'nade' to throw the chosen grenade.
  • amx_INT_unallow <player's partial name> <1 | 0> - Allows(1)/Disallows(0) a specific player to instantly throw grenades. Requires ADMIN_KICK flag.
  • amx_INT_unallowed - Shows in console all players that are unallowed to instantly throw grenades. This is good for admins that don't remember/know who is unallowed.
  • nade - Changes the player's throwing/chosen grenade. It's changing order is as follows: HE --> Flash --> Smoke --> HE --> etc...(sprite changes according to the choice, if INT_icons is 1, as said above). Should be bound to a key.
  • nade_throw_type - Changes the throwing type(look up the post for types). Should be bound to a key.
  • say /int_help - Shows information and explanation about the plugin.
  • say /int_help2 - Shows further information and explanation about the plugin.
A couple of notes:

  1. An unallowed player will stay unallowed until he disconnects or amx_INT_unallow <player's name> 0 will be executed. He won't be allowed on new round.
Installation:

  1. Download the .zip file and extract the folders to the cstrike/czero folder(haven't tested the plugin on other mods).
  2. Go to addons/amxmodx/configs and open plugins.ini.
  3. At the last line, put: instant_grenade_throw.amxx debug
P.S:

Thanks Exolent[jNr] and arkshine for optimizing a bit the nade_throw function.
Thanks Bugsy for reminding me to create a holding-grenade feature.
Thanks HiSS for Nade Choosing idea.


Required Modules:

FakeMeta
HamSandwich



Current Languages:

  1. EN - by me.
  2. DE - by ExKiLL.
  3. NL - by crazyeffect.
  4. ES - by HiSS.
  5. FR - by arkshine.
  6. SV - by DarkGod.
  7. LT - by Calibras, fixed by hleV.
  8. RO - by Mitiq.
To add a translation, check this out.


Enjoy.
Attached Files
File Type: zip instant_grenade_throw.zip (30.8 KB, 1820 views)
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 11-07-2010 at 13:28. Reason: Version 1.5
Dores is offline