Raised This Month: $ Target: $400

[L4D2] Primary Weapon Low Reserve Automatic Regeneration v1.11.2 【2022-08-04】

Post New Thread Reply   
Thread Tools Display Modes
Senior Member
Join Date: May 2021
Plugin ID:
Plugin Version:
Plugin Category:
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    Plugin Description:
    Old 02-10-2022 , 07:10   [L4D2] Primary Weapon Low Reserve Automatic Regeneration v1.11.2 【2022-08-04】
    Reply With Quote #1

    • Automatic regenerate reserve ammo of primary weapon, when sum of clip and ammo is lower than a value.
    • Press "reload" button to trigger regeneration.
    • Customizable for each weapon.

    PHP Code:
    // set to none-zero to enable debug(press IN_SPEED to clear primary weapon clip and ammo of everyone)
    // -
    // Default: "0"
    automatic_reserve_ammo_regeneration_debug "0"

    // set to none-zero to instantly regenerate ammo
    // -
    // Default: "0"
    automatic_reserve_ammo_regeneration_instantly "0" 
    • all commands promise required ADMFLAG_RESERVATION.

      :flush to the original config data file.

      :load config data from file.

      :show list of config of each weapon.

      :show config of single weapon.

      :add/change config of single weapon.

      :remove config of single weapon.

    Original configs

    a config data named "automatic_reserve_ammo_regeneration_weapons. cfg" will automatic spawn at sourcemod/data/.


    Change log
    Attached Files
    File Type: sp Get Plugin or Get Source (automatic_reserve_ammo_regeneration.sp - 0 views - 15.0 KB)

    Last edited by little_froy; 08-07-2022 at 16:13.
    little_froy is offline
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 02-10-2022 , 14:32   Re: [L4D2] Primary Weapon Low Backup Ammo Automatic Regeneration v1.9.2 【2022-02-10】
    Reply With Quote #2

    PHP Code:
            int charger GetEntPropEnt(clientProp_Send"m_pummelAttacker");
    int charger2 GetEntPropEnt(clientProp_Send"m_carryAttacker");
    int hunter GetEntPropEnt(clientProp_Send"m_pounceAttacker");
    int joackey GetEntPropEnt(clientProp_Send"m_jockeyAttacker");
    charger || charger2 || hunter || joackey 0
    It's inefficient to pull all these values and then check them. Instead pull 1 and check etc. Also "joackey" should be "jockey".

    In "OnPlayerRunCmd" you pull data from the "G_kv" keyvalue... keyvalues are slow, I think it would be faster to pull the data into an Enum Struct on plugin start or something and query that. Especially considering that "OnPlayerRunCmd" runs for EVERY client connected many times per second.

    Last edited by Silvers; 02-10-2022 at 14:32.
    Silvers is offline

    Thread Tools
    Display Modes

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

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