Raised This Month: $32 Target: $400
 8% 

[CS:S] Grenade Drop (he, flash, smoke)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
rodipm
Member
Join Date: Feb 2011
Location: Brazil
Plugin ID:
2667
Plugin Version:
1.3
Plugin Category:
Gameplay
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows you to drop your grenades like dropping normal weapons (by default pressing 'G')
    Old 11-18-2011 , 20:28   [CS:S] Grenade Drop (he, flash, smoke)
    Reply With Quote #1

    Description:

    This is a very(very very) simple plugin that allows you to drop your grenades, like HEs, smokes and flashbangs.

    Cvar:

    - "gd_dropknife" -> Allows you to drop your knife too. 0 - Don't drop | 1 - Drop / default: "gd_dropknife 0"

    Requires:

    - Only sourcemod 1.4

    Install:

    - Just put the smx file in your addons/plugins folder!


    Changelog:

    - Changed from RegConsoleCmd to AddCommandListener
    - Added a check for "m_hActiveWeapon" is a valid edict
    - Added a Cvar to allow you to drop your knife
    - Fixed both flashbang dropping.

    Thank you guys TnTSCS, Dr!fter, and GrO very much!!


    Enjoy
    Attached Files
    File Type: sp Get Plugin or Get Source (grenadedrop.sp - 3632 views - 2.4 KB)

    Last edited by rodipm; 11-26-2011 at 09:47.
    rodipm is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 11-18-2011 , 21:48   Re: [CS:S] Grenade Drop (he, flash, smoke)
    Reply With Quote #2

    neat... I wish this was allowed by default...
    TnTSCS is offline
    Dr!fter
    The Salt Boss
    Join Date: Mar 2007
    Old 11-18-2011 , 22:09   Re: [CS:S] Grenade Drop (he, flash, smoke)
    Reply With Quote #3

    You should use AddCommandListner rather then RegConsoleCmd. Otherwise everything looks good! Once you make that change I'll Approve this
    Dr!fter is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 11-18-2011 , 22:24   Re: [CS:S] Grenade Drop (he, flash, smoke)
    Reply With Quote #4

    Thanks for this!
    KyleS is offline
    rodipm
    Member
    Join Date: Feb 2011
    Location: Brazil
    Old 11-19-2011 , 10:09   Re: [CS:S] Grenade Drop (he, flash, smoke)
    Reply With Quote #5

    Dr!fter, already changed from RegConsoleCmd to AddCommandListener

    thanks
    rodipm is offline
    Despirator
    Senior Member
    Join Date: Jun 2011
    Location: Kazakhstan ->Shymkent
    Old 11-19-2011 , 10:54   Re: [CS:S] Grenade Drop (he, flash, smoke)
    Reply With Quote #6

    why did you do return Plugin_Handled on the successful drop? server won't log "drop" command
    Despirator is offline
    rodipm
    Member
    Join Date: Feb 2011
    Location: Brazil
    Old 11-19-2011 , 13:22   Re: [CS:S] Grenade Drop (he, flash, smoke)
    Reply With Quote #7

    Quote:
    Originally Posted by Despirator View Post
    why did you do return Plugin_Handled on the successful drop? server won't log "drop" command
    because for some reason when you use drop to grenades it will drop the actuall grenade but will drop the next weapon too. I don't know why it happens, but i had to return Plugin_Handled to not drop the next weapon
    __________________
    rodipm is offline
    GrO
    Veteran Member
    Join Date: Jun 2010
    Location: Poland
    Old 11-19-2011 , 14:04   Re: [CS:S] Grenade Drop (he, flash, smoke)
    Reply With Quote #8

    Nice little plugin, thanks. Few years ago es_tools was allowing such functionality, but since I've stopped using ES long time ago there was nothing like this for SM, good job.
    GrO is offline
    rodipm
    Member
    Join Date: Feb 2011
    Location: Brazil
    Old 11-19-2011 , 14:12   Re: [CS:S] Grenade Drop (he, flash, smoke)
    Reply With Quote #9

    Tanks GrO!
    __________________
    rodipm is offline
    databomb
    Veteran Member
    Join Date: Jun 2009
    Location: california
    Old 11-19-2011 , 16:57   Re: [CS:S] Grenade Drop (he, flash, smoke)
    Reply With Quote #10

    Excellent idea! Also, you might want to check if m_hActiveWeapon returns -1 because while it *is* a valid return value, it won't be so great when you try to get the classname for that. I'd advise IsValidEdict
    __________________

    Last edited by databomb; 11-19-2011 at 16:57.
    databomb is offline
    Reply



    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 20:48.


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