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

[L4D & L4D2] BackGround Reloading (QuickSwitch Plus) v1.2 [5-December-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Plugin ID:
8312
Plugin Version:
1.2
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
7 
Plugin Description:
make ammo reloading during gun deactivated
Old 12-02-2022 , 18:03   [L4D & L4D2] BackGround Reloading (QuickSwitch Plus) v1.2 [5-December-2022]
Reply With Quote #1

about
  • idea from destiny 2 perk AUTO-LOADING HOLSTER
  • they wont auto reload when you switch it to backpack, you must start reloading then switch
  • can scale the duration of background reload
  • can specify which weapon available and load one by one
  • reload sound support
  • design for high pressure battle like damn map buried deep

[L4D & L4D2] BackGround Reloading (QuickSwitch Plus) (SourceMod)


ConVars
PHP Code:
// which weapons to access plugin: 1=hunting 2=military 4=scout 8=awp 16=magnum
// 32=m16 64=sg552 128=desert 256=ak47 512=m60 1024=uzi 2048=mac10 4096=mp5 8192=pistol
// 16384=pump 32768=chrome 65536=xm1014 131072=spas12 262144=GL.
// 524287=All -1=All add numbers together you want
reload_deactivated_access "524287"

// scaler of the background reload duration
reload_deactivated_duration "1.0"

// which sounds should emit to client 1=reload success 2=loaded by *_stepload 3=All
reload_deactivated_sounds "3"

// which weapons reload as one by one, default is shotguns, option see *_access
reload_deactivated_stepload "245760" 

todos
  • - success sound (done)
  • - reloading sound (shotgun only, if needed edit yourself)
  • - specify which weapon available to quickswitch plus (done)
  • - specify which weapon reload bullet by bullet like shotgun (done)
  • - scale the reload duration (done)
  • - background reload without reloading first? (no prefer, i dont need and hard to read reload duration)



changelog
  • v1.0 just early access; 3-December-2022
  • v1.1 officially released:
    new ConVar *_duration to scale the duration of background reload,
    shotgun now reload bullet by bullet; 4-December-2022
  • v1.2 new features and fix:
    fix a potential variable leak issue (rarely about shotgun),
    new ConVar *_access to allow which weapon can be background reloading,
    new ConVar *_stepload to allow which gun reload ammo one by one, default is shoutguns,
    new ConVar *_sounds to allow which sound should emit to client, load or success, success sound fully supoprt,
    change weapon class matches to more effective way, thanks to Silvers,
    optimize 'stepload' logic, more similar to game vanilla,
    if didnt installed L4DD yet then throw error,
    uploaded video https://youtu.be/DRcLd1QCVkg; 5-December-2022


Installation
Attached Files
File Type: sp Get Plugin or Get Source (l4d_reload_deactivated.sp - 567 views - 15.9 KB)
__________________

Last edited by NoroHime; 12-04-2022 at 14:35.
NoroHime is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 12-03-2022 , 18:35   Re: [L4D & L4D2] BackGround Reloading (QuickSwitch Plus) v1.1 [4-December-2022]
Reply With Quote #2

officially release this, work as game vanilla now,.
make reload bullet by bullet so complex here i almost give up.
for sound part should took many time to do
__________________
NoroHime is offline
little_froy
Senior Member
Join Date: May 2021
Old 12-03-2022 , 20:23   Re: [L4D & L4D2] BackGround Reloading (QuickSwitch Plus) v1.1 [4-December-2022]
Reply With Quote #3

a method to get max clip.

Code:
int max_clip_size = 0;
int weapon = CreateEntityByName("weapon_rifle");
if(weapon != -1)
{
    if(DispatchSpawn(weapon))
    {
        max_clip_size = GetEntProp(weapon, Prop_Data, "m_iClip1");
    }
    RemoveEntity(weapon);
}

Last edited by little_froy; 12-03-2022 at 20:25.
little_froy is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 12-03-2022 , 20:33   Re: [L4D & L4D2] BackGround Reloading (QuickSwitch Plus) v1.1 [4-December-2022]
Reply With Quote #4

Quote:
Originally Posted by little_froy View Post
a method to get max clip.

Code:
int max_clip_size = 0;
int weapon = CreateEntityByName("weapon_rifle");
if(weapon != -1)
{
    if(DispatchSpawn(weapon))
    {
        max_clip_size = GetEntProp(weapon, Prop_Data, "m_iClip1");
    }
    RemoveEntity(weapon);
}
That is quite inefficient.

Use left4dhooks function
PHP Code:
max_clip_size  L4D2_GetIntWeaponAttribute("weapon_rifle"L4D2IWA_ClipSize); 
__________________
HarryPotter is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 12-04-2022 , 14:27   Re: [L4D & L4D2] BackGround Reloading (QuickSwitch Plus) v1.1 [4-December-2022]
Reply With Quote #5

Quote:
Originally Posted by little_froy View Post
a method to get max clip.

Code:
int max_clip_size = 0;
int weapon = CreateEntityByName("weapon_rifle");
if(weapon != -1)
{
    if(DispatchSpawn(weapon))
    {
        max_clip_size = GetEntProp(weapon, Prop_Data, "m_iClip1");
    }
    RemoveEntity(weapon);
}
hmmm... if i can use L4DD clearly do that, why not ? these will make littble bit confuses, if player didnt pickup the weapon, clip property is only available ammo property, this actually is a viable solution, but really not necessary.

then update
Quote:

ConVars
PHP Code:
// which weapons to access plugin: 1=hunting 2=military 4=scout 8=awp 16=magnum
// 32=m16 64=sg552 128=desert 256=ak47 512=m60 1024=uzi 2048=mac10 4096=mp5 8192=pistol
// 16384=pump 32768=chrome 65536=xm1014 131072=spas12 262144=GL.
// 524287=All -1=All add numbers together you want
reload_deactivated_access "524287"

// which sounds should emit to client 1=reload success 2=loaded by *_stepload 3=All
reload_deactivated_sounds "3"

// which weapons reload as one by one, default is shotguns, option see *_access
reload_deactivated_stepload "245760" 
todos
  • - success sound (done)
  • - reloading sound (shotgun only, if needed edit yourself)
  • - specify which weapon available to quickswitch plus (done)
  • - specify which weapon reload bullet by bullet like shotgun (done)
  • - scale the reload duration (done)
  • - background reload without reloading first? (no prefer, i dont need and hard to read reload duration)



changelog
  • v1.2 new features and fix:
    fix a potential variable leak issue (rarely about shotgun),
    new ConVar *_access to allow which weapon can be background reloading,
    new ConVar *_stepload to allow which gun reload ammo one by one, default is shoutguns,
    new ConVar *_sounds to allow which sound should emit to client, load or success, success sound fully supoprt,
    change weapon class matches to more effective way, thanks to Silvers,
    optimize 'stepload' logic, more similar to game vanilla,
    if didnt installed L4DD yet then throw error,
    uploaded video https://youtu.be/DRcLd1QCVkg; 5-December-2022
__________________

Last edited by NoroHime; 12-04-2022 at 14:34.
NoroHime is offline
cool_bro
New Member
Join Date: Dec 2022
Old 12-11-2022 , 06:25   Re: [L4D & L4D2] BackGround Reloading (QuickSwitch Plus) v1.2 [5-December-2022]
Reply With Quote #6

norohime idk , the plugins didn't work for me even i ve been installed the left 4 dead hooks (and dhooks ektenstion) but it's still not working maybe can someone tell me how the plugins works?
EDIT:sorry i am new with sourcemod so i am kinda taboo about all of this and sorry my bad english

Last edited by cool_bro; 12-11-2022 at 12:31.
cool_bro is offline
NoroHime
Veteran Member
Join Date: Aug 2016
Location: bed
Old 12-11-2022 , 08:40   Re: [L4D & L4D2] BackGround Reloading (QuickSwitch Plus) v1.2 [5-December-2022]
Reply With Quote #7

Quote:
Originally Posted by cool_bro View Post
norohime idk , the plugins didn't work for me even i ve been installed the left 4 dead hooks (and dhooks ektenstion) but it's still not working please help
what version you using? SM and L4DD,plugin using newer syntax, if online compiler not work try compile yourself and check compiler output message
__________________

Last edited by NoroHime; 12-11-2022 at 08:49.
NoroHime is offline
cool_bro
New Member
Join Date: Dec 2022
Old 12-11-2022 , 12:36   Re: [L4D & L4D2] BackGround Reloading (QuickSwitch Plus) v1.2 [5-December-2022]
Reply With Quote #8

Quote:
Originally Posted by NoroHime View Post
what version you using? SM and L4DD,plugin using newer syntax, if online compiler not work try compile yourself and check compiler output message
okay my SM is 1.11.6917 and my L4DD is 1.125 thats it and what is compile ? should i compile the plugins to works?
cool_bro is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 12-11-2022 , 14:48   Re: [L4D & L4D2] BackGround Reloading (QuickSwitch Plus) v1.2 [5-December-2022]
Reply With Quote #9

Quote:
Originally Posted by cool_bro View Post
norohime idk , the plugins didn't work for me even i ve been installed the left 4 dead hooks (and dhooks ektenstion) but it's still not working maybe can someone tell me how the plugins works?
EDIT:sorry i am new with sourcemod so i am kinda taboo about all of this and sorry my bad english
Type in your server console and see if any error
PHP Code:
sm plugins info l4d_reload_deactivated 
__________________
HarryPotter is offline
cool_bro
New Member
Join Date: Dec 2022
Old 12-11-2022 , 21:49   Re: [L4D & L4D2] BackGround Reloading (QuickSwitch Plus) v1.2 [5-December-2022]
Reply With Quote #10

Quote:
Originally Posted by HarryPotter View Post
Type in your server console and see if any error
PHP Code:
sm plugins info l4d_reload_deactivated 
Yeah it's say :You must install "[L4D & L4D2] Left 4 DHooks Direct" to run this plugin: https://forums.alliedmods.net/showthread.php?t=321696

but i already installed the l4dd

Last edited by cool_bro; 12-11-2022 at 21:50.
cool_bro 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 09:04.


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