Raised This Month: $51 Target: $400
 12% 

[CSS|CS:GO] All grenades and knifes drop


Post New Thread Reply   
 
Thread Tools Display Modes
Author
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Plugin ID:
3856
Plugin Version:
1.0.3
Plugin Category:
Gameplay
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    4 
    Plugin Description:
    Allows players to drop all grenades and knife of your inventory
    Old 08-25-2013 , 19:49   [CSS|CS:GO] All grenades and knifes drop
    Reply With Quote #1

    All Grenades and Knife drop


    .:: Functionality ::.

    Allows players to drop all grenades of your inventory

    This plugin has been rewritten from the original made by member: Rodipm
    Original thread: http://forums.alliedmods.net/showthread.php?t=172315

    The cause of rewriting the plugin? Support bugs and add cvars.

    I removed knife drop function. Added again.

    .:: Original bugs fixed ::.

    Infinite grenades: http://forums.alliedmods.net/showpos...2&postcount=11
    Drop all grenades instead drop each: https://forums.alliedmods.net/showpo...5&postcount=11
    Impossible to pick up on the floor after drop: https://forums.alliedmods.net/showpo...8&postcount=12 and https://forums.alliedmods.net/showpo...86&postcount=2
    No support for tagrenades: https://forums.alliedmods.net/showpo...27&postcount=5

    .:: CVARs ::.
    • sm_grenadedrop_enabled = 1/0 - Plugin is enabled/disabled. (def. 1) [CSS | CS:GO]
    • sm_grenadedrop_he = 0/1 - Allow drop HE Grenades? (def. 1) [CSS | CS:GO]
    • sm_grenadedrop_flash = 0/1 Allow drop FLASH Grenades? (def. 1) [CSS | CS:GO]
    • sm_grenadedrop_smoke = 0/1 Allow drop SMOKE Grenades? (def. 1) [CSS | CS:GO]
    • sm_grenadedrop_molotov = 0/1 Allow drop MOLOTOVS? (def. 1) [CS:GO]
    • sm_grenadedrop_inc = 0/1 Allow drop INC? (def. 1) [CS:GO]
    • sm_grenadedrop_decoy = 0/1 Allow drop DECOY Grenades? (def. 1) [CS:GO]
    • sm_grenadedrop_ta = 0/1 Allow drop TA Grenades? (def. 1) [CS:GO]
    • sm_grenadedrop_knife = 0/1 Allow drop KNIFE? (def. 1) [CSS | CS:GO]
    • sm_grenadedrop_version - Current plugin version

    .:: Changelog ::.
    Spoiler


    .:: Work games ::.
    • Counter-Strike Source
    • Counter-Strike Global Offensive

    .:: Attention ::.
    • Now you can drop only one of each type of grenade.
    • mp_drop_knife_enable cvar override sm_grenadedrop_knife cvar settings (CSGO)

    .:: Credits ::.

    Rodrigo286
    Rodipm

    Thanks and please comment !
    Attached Files
    File Type: sp Get Plugin or Get Source (sm_grenade_drop.sp - 765 views - 9.7 KB)
    __________________
    My Plugins | VIEW HERE | I accept private requests, send me a PM.
    Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
    Meet the Medic | Disguise Expert | Crazy Jet

    CZSBrasil TEAM

    Last edited by rodrigo286; 03-14-2018 at 10:28.
    rodrigo286 is offline
    homerjsimpson
    BANNED
    Join Date: Feb 2009
    Location: https://t.me/pump_upp
    Old 08-25-2013 , 19:55   Re: [CSS] Grenade drop
    Reply With Quote #2

    Nice. Thks for the fixes
    homerjsimpson is offline
    Send a message via ICQ to homerjsimpson Send a message via AIM to homerjsimpson Send a message via Yahoo to homerjsimpson Send a message via Skype™ to homerjsimpson
    XenTerSiO
    SourceMod Donor
    Join Date: Nov 2011
    Location: Black Mesa
    Old 08-25-2013 , 20:04   Re: [CSS] Grenade drop
    Reply With Quote #3

    Thanks!
    XenTerSiO is offline
    Blowst
    Senior Member
    Join Date: Feb 2011
    Location: Korea, Republic of
    Old 08-26-2013 , 04:00   Re: [CSS] Grenade drop
    Reply With Quote #4

    You can fix the bug with m_nSequence too.

    PHP Code:
            //CS:S  iGame = 1
            //CS:GO iGame = 2
            
            
    new nSequence GetEntProp(weaponProp_Data"m_nSequence");
            if(...)
            {
                if(
    nSequence == || nSequence == || (nSequence == && iGame == 1) || (nSequence == && iGame == 2)) // Block nade duplicating by dropping a nade when player is uping his arm (right before throwing).

                
    or

                if((
    nSequence != && iGame == 1) || (nSequence != && iGame == 2)) // Block nade duplicating by dropping a nade when player is uping his arm (right before throwing).
                
    {
                    
    //codes of dropping a weapon...
                
    }
            }
        }

    Code:
    The m_nSequence values of nade
    
    in CS:S,
    
    0 = Player in handling a nade.
    1 = When a player gets ready to throw his nade. (pin has been pulled)
    5 = When a nade has been thrown.
    6 = When a player takes his nade out of his holder. (switch active weapon into a grenade)
    
    in CS:GO,
    
    0 = Player in handling a nade.
    1 = When a player gets ready to throw his nade. (pin has been pulled)
    2 = When a nade has been thrown.
    3 = When a player takes his nade out of his holder. (switch active weapon into a grenade)
    refer to this
    __________________
    Sorry about my poor English

    Blowst is offline
    rodrigo286
    Veteran Member
    Join Date: Sep 2010
    Location: Brazil, São Paulo
    Old 08-26-2013 , 08:29   Re: [CSS] Grenade drop
    Reply With Quote #5

    Quote:
    Originally Posted by Blowst View Post
    You can fix the bug with m_nSequence too.

    PHP Code:
            //CS:S  iGame = 1
            //CS:GO iGame = 2
            
            
    new nSequence GetEntProp(weaponProp_Data"m_nSequence");
            if(...)
            {
                if(
    nSequence == || nSequence == || (nSequence == && iGame == 1) || (nSequence == && iGame == 2)) // Block nade duplicating by dropping a nade when player is uping his arm (right before throwing).

                
    or

                if((
    nSequence != && iGame == 1) || (nSequence != && iGame == 2)) // Block nade duplicating by dropping a nade when player is uping his arm (right before throwing).
                
    {
                    
    //codes of dropping a weapon...
                
    }
            }
        }

    Code:
    The m_nSequence values of nade
    
    in CS:S,
    
    0 = Player in handling a nade.
    1 = When a player gets ready to throw his nade. (pin has been pulled)
    5 = When a nade has been thrown.
    6 = When a player takes his nade out of his holder. (switch active weapon into a grenade)
    
    in CS:GO,
    
    0 = Player in handling a nade.
    1 = When a player gets ready to throw his nade. (pin has been pulled)
    2 = When a nade has been thrown.
    3 = When a player takes his nade out of his holder. (switch active weapon into a grenade)
    refer to this
    Thanks for this tip, this method is also an option.
    __________________
    My Plugins | VIEW HERE | I accept private requests, send me a PM.
    Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
    Meet the Medic | Disguise Expert | Crazy Jet

    CZSBrasil TEAM

    Last edited by rodrigo286; 08-26-2013 at 08:30.
    rodrigo286 is offline
    Dr!fter
    The Salt Boss
    Join Date: Mar 2007
    Old 08-26-2013 , 14:38   Re: [CSS] Grenade drop
    Reply With Quote #6

    Are you sure this works on CS:GO the index's for grenades are wrong for CS:GO.
    Dr!fter is offline
    rodrigo286
    Veteran Member
    Join Date: Sep 2010
    Location: Brazil, São Paulo
    Old 08-26-2013 , 14:48   Re: [CSS] Grenade drop
    Reply With Quote #7

    Quote:
    Originally Posted by Dr!fter View Post
    Are you sure this works on CS:GO the index's for grenades are wrong for CS:GO.
    My friend installed it on his CSGO server, but today I'll post the official version that supports CSGO and I'll test.

    CS:GO Grenade index's
    PHP Code:
    #define HEGrenadeOffset 13
    #define FlashbangOffset 14
    #define SmokegrenadeOffset 15
    #define IncenderyGrenadesOffset 16
    #define DecoyGrenadeOffset 17 
    Thanks
    __________________
    My Plugins | VIEW HERE | I accept private requests, send me a PM.
    Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
    Meet the Medic | Disguise Expert | Crazy Jet

    CZSBrasil TEAM

    Last edited by rodrigo286; 08-26-2013 at 14:51.
    rodrigo286 is offline
    rodrigo286
    Veteran Member
    Join Date: Sep 2010
    Location: Brazil, São Paulo
    Old 08-26-2013 , 17:58   Re: [CSS|CS:GO] Grenade drop
    Reply With Quote #8

    OFICIAL CSGO SUPPORT ADDED

    PLUGIN UPDATED ON FIRST POST !

    Regards.
    __________________
    My Plugins | VIEW HERE | I accept private requests, send me a PM.
    Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
    Meet the Medic | Disguise Expert | Crazy Jet

    CZSBrasil TEAM
    rodrigo286 is offline
    TnTSCS
    AlliedModders Donor
    Join Date: Oct 2010
    Location: Undisclosed...
    Old 08-26-2013 , 18:08   Re: [CSS|CS:GO] Grenade drop
    Reply With Quote #9

    a perfect place for the new forward :8

    PHP Code:
    /**
     * Global listener for the chat commands.
     *
     * @param client        Client index.
     * @param command        Command name.
     * @param sArgs            Chat argument string.
     * 
     * @return                An Action value. Returning Plugin_Handled bypasses the game function call.
                                Returning Plugin_Stop bypasses the post hook as well as the game function.
     */
    forward Action:OnClientSayCommand(client, const String:command[], const String:sArgs[]); 

    ^^ eh, maybe not ^^

    Oh, and maybe determine the game once at the start of the plugin instead of checking it each time "drop" is used... create a global bool to check - little faster? Maybe not enough to make a difference though.
    __________________
    View my Plugins | Donate

    Last edited by TnTSCS; 08-26-2013 at 18:19.
    TnTSCS is offline
    rodrigo286
    Veteran Member
    Join Date: Sep 2010
    Location: Brazil, São Paulo
    Old 08-26-2013 , 18:55   Re: [CSS|CS:GO] Grenade drop
    Reply With Quote #10

    Quote:
    Originally Posted by TnTSCS View Post
    a perfect place for the new forward :8

    PHP Code:
    /**
     * Global listener for the chat commands.
     *
     * @param client        Client index.
     * @param command        Command name.
     * @param sArgs            Chat argument string.
     * 
     * @return                An Action value. Returning Plugin_Handled bypasses the game function call.
                                Returning Plugin_Stop bypasses the post hook as well as the game function.
     */
    forward Action:OnClientSayCommand(client, const String:command[], const String:sArgs[]); 

    ^^ eh, maybe not ^^

    Oh, and maybe determine the game once at the start of the plugin instead of checking it each time "drop" is used... create a global bool to check - little faster? Maybe not enough to make a difference though.
    This?

    PHP Code:
        decl String:game[12];
        
    GetGameFolderName(gamesizeof(game));

        if(
    StrContains(game"cstrike") != -1)
        {
            
    AddCommandListener(Drop_CSS"drop");
        }
        else if(
    StrContains(game"csgo") != -1)
        {
            
    AddCommandListener(Drop_CSGO"drop");
        } 
    This works well.

    Thanks.
    __________________
    My Plugins | VIEW HERE | I accept private requests, send me a PM.
    Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
    Meet the Medic | Disguise Expert | Crazy Jet

    CZSBrasil TEAM
    rodrigo286 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 18:53.


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