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

[L4D2] Infinite Reserve Ammo(Limited) v3.4【2024-03-16】


Post New Thread Reply   
 
Thread Tools Display Modes
Author
little_froy
Senior Member
Join Date: May 2021
Plugin ID:
7961
Plugin Version:
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    game play
    Old 02-10-2022 , 07:10   [L4D2] Infinite Reserve Ammo(Limited) v3.4【2024-03-16】
    Reply With Quote #1

    Description
    • Limited infinite reserve ammo, automatically generate when sum of clip and reserve ammo is lower than the "reserve_ammo".
    • Customizable for each weapon.

    Cvars
    PHP Code:
    limited_infinite_reserve_ammo_path "data/limited_infinite_reserve_ammo.cfg" 
    Commands
    • sm_limited_infinite_reserve_ammo_reload
      :reload config data from file.

    Change log
    Spoiler


    Configs installation
    • put limited_infinite_reserve_ammo.cfg in sourcemod/data/. if you changed the file name or path, you have to edit the cvar "path" too.
    • 0 or lower = disable.
    Attached Files
    File Type: cfg limited_infinite_reserve_ammo.cfg (988 Bytes, 20 views)
    File Type: sp Get Plugin or Get Source (limited_infinite_reserve_ammo.sp - 14 views - 5.2 KB)

    Last edited by little_froy; 03-16-2024 at 06:22.
    little_froy is online now
    Silvers
    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");
            return 
    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
    little_froy
    Senior Member
    Join Date: May 2021
    Old 10-23-2022 , 03:37   Re: [L4D2] Primary Weapon Low Backup Ammo Automatic Regeneration v1.9.2 【2022-02-10】
    Reply With Quote #3

    Quote:
    Originally Posted by Silvers View Post
    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");
            return 
    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.
    finally i made it.
    little_froy is online now
    little_froy
    Senior Member
    Join Date: May 2021
    Old 12-14-2022 , 03:51   Re: [L4D2] Infinite Reserve Ammo v2.0【2022-12-14】
    Reply With Quote #4

    Code:
    2.0 (2022-12-14:
    now ammo will generate instantly when sum of clip and reserve ammo is lower than the "max".
    add cvar "infinite_reserve_ammo_optimize_for_listen_server_host".
    new version naming style.

    Last edited by little_froy; 12-14-2022 at 03:52.
    little_froy is online now
    Reply


    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 09:22.


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