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

[L4D2] Ammo Pickup


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dr!fter
The Salt Boss
Join Date: Mar 2007
Plugin ID:
2608
Plugin Version:
1.1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows picking up ammo from ammo stacks for m60 and grenade launcher
    Old 10-16-2011 , 14:39   [L4D2] Ammo Pickup
    Reply With Quote #1

    This plugin enables picking up ammo for the M60 and grenade launcher. Simple.

    To set how much reserve ammo m60 and grenade launcher have use the following in server.cfg:

    sm_cvar ammo_grenadelauncher_max reserve ammo
    sm_cvar ammo_m60_max reserve ammo

    Example:

    sm_cvar ammo_grenadelauncher_max 50 //Allows a total of 51 grenades for a grenade launcher
    sm_cvar ammo_m60_max 450 //Allows a total of 600 bullets for m60

    Requires SourceMod 1.4

    Thanks:
    psychonic for all his explaining of m_iAmmo and bunch of other stuff.

    Changelog
    1.1 - Updated gamedata and changed to use SourceMod's Memory natives for patching instead of mempatch
    1.1.1 - Fixed checking wrong bytes to patch
    Attached Files
    File Type: zip l4d2_ammo_pickup.zip (6.9 KB, 5718 views)

    Last edited by Dr!fter; 07-17-2013 at 13:42.
    Dr!fter is offline
    McFlurry
    Veteran Member
    Join Date: Mar 2010
    Location: RemoveEdict(0);
    Old 10-16-2011 , 14:44   Re: [L4D2] Ammo Pickup
    Reply With Quote #2

    All that you have in OnMapStart() should be in OnPluginStart(), or else you're just constantly hooking that event every map change which means it gets called the number of times the map changed+1 every time it fires. And you should only really need to find those convars once.
    __________________
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    Dr!fter
    The Salt Boss
    Join Date: Mar 2007
    Old 10-16-2011 , 14:46   Re: [L4D2] Ammo Pickup
    Reply With Quote #3

    Oops good catch. Its fixed now. Originally there was different code in there.
    Dr!fter is offline
    MasterMind420
    BANNED
    Join Date: Nov 2010
    Old 10-16-2011 , 19:32   Re: [L4D2] Ammo Pickup
    Reply With Quote #4

    Gun Control mod by AtomicStryker does this and more, not sure if u knew that though...
    MasterMind420 is offline
    Dr!fter
    The Salt Boss
    Join Date: Mar 2007
    Old 10-17-2011 , 14:13   Re: [L4D2] Ammo Pickup
    Reply With Quote #5

    I found out a about 10 minutes before posting. Think of this as a simple solution for allowing ammo pickup for m60 and grenade launcher. No setup is really required. The extension though can be used with Gun Control as well (afaik Gun Control has no way of stopping m60 from being removed)
    Dr!fter is offline
    JoBarfCreepy
    Member
    Join Date: Feb 2011
    Location: Next to Sweden and Norwa
    Old 10-18-2011 , 10:41   Re: [L4D2] Ammo Pickup
    Reply With Quote #6

    L 10/18/2011 - 16:37:47: [SM] Native "SetEntProp" reported: SendProp m_iAmmo is not an integer ([6,0] != 0)
    L 10/18/2011 - 16:37:47: [SM] Displaying call stack trace for plugin "l4d2ammo_pickup.smx":
    L 10/18/2011 - 16:37:47: [SM] [0] Line 39, C:\Users\Gaming\Desktop\L4D2-Stuff\l4d2ammo_pickup.sp::OnWeaponDosntUseAmmo()

    Think you spelled "Doesn't" wrong.
    JoBarfCreepy is offline
    Dr!fter
    The Salt Boss
    Join Date: Mar 2007
    Old 10-18-2011 , 13:58   Re: [L4D2] Ammo Pickup
    Reply With Quote #7

    Post the output of

    sm version
    Dr!fter is offline
    Dr!fter
    The Salt Boss
    Join Date: Mar 2007
    Old 11-20-2011 , 16:58   Re: [L4D2] Ammo Pickup
    Reply With Quote #8

    Updated to use MemPatch extension instead to patch the weapon drop on the m60.
    Dr!fter is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 11-22-2011 , 00:09   Re: [L4D2] Ammo Pickup
    Reply With Quote #9

    Nice!
    KyleS is offline
    disawar1
    AlliedModders Donor
    Join Date: Aug 2011
    Location: Russian
    Old 11-28-2011 , 00:01   Re: [L4D2] Ammo Pickup
    Reply With Quote #10

    ty i like this
    __________________
    disawar1 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 03:52.


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