AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Infinite Reserve Ammo(Limited) v3.4【2024-03-16】 (https://forums.alliedmods.net/showthread.php?t=336301)

little_froy 02-10-2022 07:10

[L4D2] Infinite Reserve Ammo(Limited) v3.4【2024-03-16】
 
2 Attachment(s)
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.

Silvers 02-10-2022 14:32

Re: [L4D2] Primary Weapon Low Backup Ammo Automatic Regeneration v1.9.2 【2022-02-10】
 
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.

little_froy 10-23-2022 03:37

Re: [L4D2] Primary Weapon Low Backup Ammo Automatic Regeneration v1.9.2 【2022-02-10】
 
Quote:

Originally Posted by Silvers (Post 2771070)
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 12-14-2022 03:51

Re: [L4D2] Infinite Reserve Ammo v2.0【2022-12-14】
 
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.



All times are GMT -4. The time now is 17:02.

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