Raised This Month: $ Target: $400
 0% 

[L4D2] Take Ammo From Previous Weapon v1.3.1 [17-August-2023]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Plugin ID:
8286
Plugin Version:
1.3.1
Plugin Category:
All
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
 
Plugin Description:
take the ammo from previous weapon when picking same gun or same ammo
Old 11-12-2022 , 21:57   [L4D2] Take Ammo From Previous Weapon v1.3.1 [17-August-2023]
Reply With Quote #1

about
  • take the ammo from previous weapon
  • optional same gun or same ammo or similar ammo
  • part of my realism part

ConVar

PHP Code:
// 0=pick when same gun 1=pick when same ammo type 2=same type with custom list (*_pass_list#)
ammo_previous_pass "1"

// allow pick ammo from gun pile(spawn point)
ammo_previous_pile "1"

// similar ammo types list when set *_pass to 2, default: shotguns
ammo_previous_pass_list1 "7,8"

// similar ammo types list when set *_pass to 2, default: rifles and smgs
ammo_previous_pass_list2 "3,5"

// similar ammo types list when set *_pass to 2, default snipers and m60
ammo_previous_pass_list3 "9,10,6" 

changelog
  • v1.0 just releases; 13-November-2022
  • v1.1 new ConVar *_pile to allow pick ammo from gun pile, even pile just one gun only; 16-November-2022
  • v1.1.1 fix an issue 'plugin wont record max ammo without picking weapon' will causes plugin not working on first map; 26-November-2022
  • v1.2 new features, fixes, optimizes:
    - ConVar *_pass set to 2 to pass on custom ammotype lists,
    - new ConVars *_pass_list# to control which ammotype is similar, work on *_pass = 2,
    - fix unexpected upgraded ammo behavior, will record wrong max ammo,
    - turn code style to OOP-ish, simplify code (maybe),
    - fix plugin not work when didnt active weapon yet; 9-December-2022
  • v1.3 (28-May-2023)
    - fully compatible with '[L4D/L4D2] Reserve Control'
    - overhaul max reserved ammo value getting way from in-game calcs to read from ConVars
    - fix sometime weird ammo count
  • v1.3.1 (17-August-2023)
    - fix big bug got incorrect reserved ammo caused weird clip size

Installation
Attached Files
File Type: sp Get Plugin or Get Source (l4d_ammo_previous.sp - 431 views - 22.7 KB)
__________________

Last edited by NoroHime; 08-16-2023 at 13:58.
NoroHime is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 12-08-2022 , 16:21   Re: [L4D & L4D2] Take Ammo From Previous Weapon v1.2 [9-December-2022]
Reply With Quote #2

update these, i dont known does someone need list 4... haha may not
PHP Code:
// similar ammo types list when set *_pass to 2, default: shotguns
ammo_previous_pass_list1 "7,8"

// similar ammo types list when set *_pass to 2, default: rifles and smgs
ammo_previous_pass_list2 "3,5"

// similar ammo types list when set *_pass to 2, default snipers and m60
ammo_previous_pass_list3 "9,10,6" 

changelog
  • v1.2 new features, fixes, optimizes:
    - ConVar *_pass set to 2 to pass on custom ammotype lists,
    - new ConVars *_pass_list# to control which ammotype is similar, work on *_pass = 2,
    - fix unexpected upgraded ammo behavior, will record wrong max ammo,
    - turn code style to OOP-ish, simplify code (maybe),
    - fix plugin not work when didnt active weapon yet; 9-December-2022
__________________

Last edited by NoroHime; 12-08-2022 at 16:22.
NoroHime is offline
z282846139
Member
Join Date: Aug 2018
Old 01-11-2023 , 11:24   Re: [L4D & L4D2] Take Ammo From Previous Weapon v1.2 [9-December-2022]
Reply With Quote #3

Could you tell me how to take ammo from previous weapon when picking same gun or same ammo, what is the
difference between the original game?
z282846139 is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 01-11-2023 , 14:57   Re: [L4D & L4D2] Take Ammo From Previous Weapon v1.2 [9-December-2022]
Reply With Quote #4

Quote:
Originally Posted by z282846139 View Post
Could you tell me how to take ammo from previous weapon when picking same gun or same ammo, what is the
difference between the original game?
these procdure is automatically, the weapon your newer pick always got ammo by transfer from previous weapon, so finally previous weapon actually reduce ammo, many time you wont notice that, otherwise you or another player use different ammo type to pick that,
on the vanilla game, it has these priority
1)always pick difference weapon.
2)always pick difference skin but same weapon(from The Last Stand update, few weapons has skin).
3)always pick difference upgrade weapon.
4)otherwise same gun, pick the larger ammo one.
5)above situation failed, them didnt pick.
above 5 situation you finally encounter chosen, usually choose the more ammo one, so ammo transfer is plugin primary todo
__________________

Last edited by NoroHime; 01-11-2023 at 15:07.
NoroHime is offline
z282846139
Member
Join Date: Aug 2018
Old 01-12-2023 , 09:08   Re: [L4D & L4D2] Take Ammo From Previous Weapon v1.2 [9-December-2022]
Reply With Quote #5

Quote:
Originally Posted by NoroHime View Post
these procdure is automatically, the weapon your newer pick always got ammo by transfer from previous weapon, so finally previous weapon actually reduce ammo, many time you wont notice that, otherwise you or another player use different ammo type to pick that,
on the vanilla game, it has these priority
1)always pick difference weapon.
2)always pick difference skin but same weapon(from The Last Stand update, few weapons has skin).
3)always pick difference upgrade weapon.
4)otherwise same gun, pick the larger ammo one.
5)above situation failed, them didnt pick.
above 5 situation you finally encounter chosen, usually choose the more ammo one, so ammo transfer is plugin primary todo
Thanks for you reply, I've got what happend with it, at the first time, I thought it's a plugin that take ammo form the dropped or a newer gun, so that if I have a scar with laser upgraded, bug it's out of ammo and there's no ammo pile, I can take ammo form another scar and keep my upgraded one.
z282846139 is offline
sonic155
Senior Member
Join Date: Mar 2019
Old 01-26-2023 , 06:35   Re: [L4D & L4D2] Take Ammo From Previous Weapon v1.2 [9-December-2022]
Reply With Quote #6

picking up a gun then another gun like m16 with another m16 bugs out the ammo count to a massive # i got a hunting_rifle and picked up another hunting rifle and got ammo 226 as full set there was no reload nor any backup ammo just full 226 it seems to happen anytime someone picks up the same gun thats on the floor
sonic155 is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 01-27-2023 , 01:04   Re: [L4D & L4D2] Take Ammo From Previous Weapon v1.2 [9-December-2022]
Reply With Quote #7

Quote:
Originally Posted by sonic155 View Post
picking up a gun then another gun like m16 with another m16 bugs out the ammo count to a massive # i got a hunting_rifle and picked up another hunting rifle and got ammo 226 as full set there was no reload nor any backup ammo just full 226 it seems to happen anytime someone picks up the same gun thats on the floor
im locating this issue but so hard, my friend encounter this but very rared, anyway i focus this
__________________
NoroHime is offline
sonic155
Senior Member
Join Date: Mar 2019
Old 01-27-2023 , 06:22   Re: [L4D & L4D2] Take Ammo From Previous Weapon v1.2 [9-December-2022]
Reply With Quote #8

i think setting this

l4d2_AR_FrameCount "10"

fixed it as i cant seem to make it happen anymore
sonic155 is offline
chungocanh12
Member
Join Date: Apr 2023
Location: Việt Nam
Old 04-20-2023 , 01:43   Re: [L4D & L4D2] Take Ammo From Previous Weapon v1.2 [9-December-2022]
Reply With Quote #9

please fix it, it's conflicting with the plugin: https://forums.alliedmods.net/showthread.php?p=889437
if i don't use pack rat skill but when i pick up ammo from a gun dropped on the ground i will default to pick up x2 reserve ammo like i was learning pack rat skill
chungocanh12 is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 05-28-2023 , 15:56   Re: [L4D & L4D2] Take Ammo From Previous Weapon v1.3 [9-December-2022]
Reply With Quote #10

update, should fix some bugged ammo count.
by the plugin l4d_reservecontrol reason, past version record the max ammo to known reserved size rather than read game ConVars.
Quote:
changelog
  • v1.3 (28-May-2023)
    - fully compatible with '[L4D/L4D2] Reserve Control'
    - overhaul max reserved ammo value getting way from in-game calcs to read from ConVars
    - fix sometime weird ammo count
  • v1.3.1 (17-August-2023)
    - fix big bug got incorrect reserved ammo caused weird clip size
__________________

Last edited by NoroHime; 08-16-2023 at 13:58.
NoroHime is offline
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 11:49.


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