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

[L4D & L4D2] Left 4 DHooks Direct (1.146) [21-Apr-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
fdxx
Member
Join Date: Oct 2020
Location: 0xdeadbeef
Old 07-02-2021 , 10:07   Re: [L4D & L4D2] Left 4 DHooks Direct (1.44) [01-Jul-2021]
Reply With Quote #351

Quote:
Originally Posted by Silvers View Post
You're right, thanks for reporting the mistake. Test plugin shows correct usage.
Thank you for your great work
fdxx is offline
Alexmy
Senior Member
Join Date: Oct 2014
Location: Russian Federation
Old 07-03-2021 , 10:00   Re: [L4D & L4D2] Left 4 DHooks Direct (1.44) [01-Jul-2021]
Reply With Quote #352

Hi Silvers, I can with the help of Left 4 DHooks Direct increase the ammo in the clip1 of the weapon?

Last edited by Alexmy; 07-03-2021 at 10:00.
Alexmy is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-03-2021 , 11:36   Re: [L4D & L4D2] Left 4 DHooks Direct (1.44) [01-Jul-2021]
Reply With Quote #353

Quote:
Originally Posted by Alexmy View Post
Hi Silvers, I can with the help of Left 4 DHooks Direct increase the ammo in the clip1 of the weapon?
To increase the clip size or the reserve ammo? Clip size it's better to use Info Editor (make sure to also install "[L4D & L4D2] Reload Fix - Max Clip Size") but yes it's possible to change clip size with Left4DHooks and for specific clients individually I think, not in L4D1 with Lef4DHooks though (Info Editor can modify in L4D1 also). There are cvars to change reserve ammo. There's an example in Left4DHooks test plugin, you'd have to write a plugin to modify players clip sizes.
__________________
Silvers is offline
Alexmy
Senior Member
Join Date: Oct 2014
Location: Russian Federation
Old 07-03-2021 , 12:09   Re: [L4D & L4D2] Left 4 DHooks Direct (1.44) [01-Jul-2021]
Reply With Quote #354

Quote:
Originally Posted by Silvers View Post
To increase the clip size or the reserve ammo? Clip size it's better to use Info Editor (make sure to also install "[L4D & L4D2] Reload Fix - Max Clip Size") but yes it's possible to change clip size with Left4DHooks and for specific clients individually I think, not in L4D1 with Lef4DHooks though (Info Editor can modify in L4D1 also). There are cvars to change reserve ammo. There's an example in Left4DHooks test plugin, you'd have to write a plugin to modify players clip sizes.
I am interested in increasing the size of the clip for certain players. I was looking through Info Editor, it acts globally for all players at once. It doesn't suit me. I tried to find the native I needed, but the description is so short that almost nothing is clear
Alexmy is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-03-2021 , 12:51   Re: [L4D & L4D2] Left 4 DHooks Direct (1.44) [01-Jul-2021]
Reply With Quote #355

Quote:
Originally Posted by Alexmy View Post
I am interested in increasing the size of the clip for certain players. I was looking through Info Editor, it acts globally for all players at once. It doesn't suit me. I tried to find the native I needed, but the description is so short that almost nothing is clear
There are examples in the test plugin:

PHP Code:
        PrintToServer("L4D2_GetIntWeaponAttribute weapon_rifle (Bullets): %d",                    L4D2_GetIntWeaponAttribute("weapon_rifle"L4D2IWA_Bullets));
        
PrintToServer("L4D2_GetIntWeaponAttribute weapon_rifle (ClipSize): %d",                    L4D2_GetIntWeaponAttribute("weapon_rifle"L4D2IWA_ClipSize));
        
PrintToServer("L4D2_GetIntWeaponAttribute weapon_rifle (Damage): %d",                    L4D2_GetIntWeaponAttribute("weapon_rifle"L4D2IWA_Damage));
        
L4D2_SetIntWeaponAttribute("weapon_rifle",                                                L4D2IWA_ClipSize100); 
And notes in the include:
PHP Code:
A note regarding ClipsizeAny nonstandard value will NOT be in effect at weapon pickupwhich means the client
has to reload once to achieve the modified value
To fix thisadd a weapon pickup hook in your plugin (eg "player_use")
and use 
something like this with a small timer delay of 0.1 seconds or more (dont you love this engine).

    new 
weapon GetPlayerWeaponSlot(client0);
    if (
weapon == INVALID_ENT_REFERENCE) return;
    
char class[56];
    
GetEdictClassname(weapon, class, sizeof(class));
    
SetEntProp(weaponProp_Send"m_iClip1"L4D2_GetIntWeaponAttribute(class, L4D2IWA_ClipSize)); 
__________________
Silvers is offline
Alexmy
Senior Member
Join Date: Oct 2014
Location: Russian Federation
Old 07-03-2021 , 13:21   Re: [L4D & L4D2] Left 4 DHooks Direct (1.44) [01-Jul-2021]
Reply With Quote #356

Quote:
Originally Posted by Silvers View Post
There are examples in the test plugin:

PHP Code:
        PrintToServer("L4D2_GetIntWeaponAttribute weapon_rifle (Bullets): %d",                    L4D2_GetIntWeaponAttribute("weapon_rifle"L4D2IWA_Bullets));
        
PrintToServer("L4D2_GetIntWeaponAttribute weapon_rifle (ClipSize): %d",                    L4D2_GetIntWeaponAttribute("weapon_rifle"L4D2IWA_ClipSize));
        
PrintToServer("L4D2_GetIntWeaponAttribute weapon_rifle (Damage): %d",                    L4D2_GetIntWeaponAttribute("weapon_rifle"L4D2IWA_Damage));
        
L4D2_SetIntWeaponAttribute("weapon_rifle",                                                L4D2IWA_ClipSize100); 
And notes in the include:
PHP Code:
A note regarding ClipsizeAny nonstandard value will NOT be in effect at weapon pickupwhich means the client
has to reload once to achieve the modified value
To fix thisadd a weapon pickup hook in your plugin (eg "player_use")
and use 
something like this with a small timer delay of 0.1 seconds or more (dont you love this engine).

    new 
weapon GetPlayerWeaponSlot(client0);
    if (
weapon == INVALID_ENT_REFERENCE) return;
    
char class[56];
    
GetEdictClassname(weapon, class, sizeof(class));
    
SetEntProp(weaponProp_Send"m_iClip1"L4D2_GetIntWeaponAttribute(class, L4D2IWA_ClipSize)); 
Thank you very much, you helped me as always. I have a related question [L4D & L4D2] Reload Fix - Max Clip Size (1.2) [29-Jun-2021]
Your source code specifies the number of ammo in the clip by default. The plugin will not conflict with my plugin that changes additional ammo in the clip?
Alexmy is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-03-2021 , 13:56   Re: [L4D & L4D2] Left 4 DHooks Direct (1.44) [01-Jul-2021]
Reply With Quote #357

The hard coded default values are those from the game, so if the players actual clip size is different then the plugin will take affect.
__________________
Silvers is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 07-03-2021 , 18:23   Re: [L4D & L4D2] Left 4 DHooks Direct (1.44) [01-Jul-2021]
Reply With Quote #358

The "L4D_OnVomitedUpon" forward crashes L4D1 servers. This is due to the "CTerrorPlayer::OnVomitedUpon" function having a 3rd parameter in that game.
PHP Code:
/* CTerrorPlayer::OnVomitedUpon(CTerrorPlayer*, bool, bool) */ 
I get this error right before the crash:
Code:
L 07/03/2021 - 15:16:45: [DHOOKS] FATAL: Failed to find return address of original function. Check the arguments and return type of your detour setup.
__________________

Last edited by Psyk0tik; 07-03-2021 at 18:24.
Psyk0tik is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-04-2021 , 00:00   Re: [L4D & L4D2] Left 4 DHooks Direct (1.44) [01-Jul-2021]
Reply With Quote #359

Quote:
Originally Posted by Crasher_3637 View Post
The "L4D_OnVomitedUpon" forward crashes L4D1 servers. This is due to the "CTerrorPlayer::OnVomitedUpon" function having a 3rd parameter in that game.
PHP Code:
/* CTerrorPlayer::OnVomitedUpon(CTerrorPlayer*, bool, bool) */ 
I get this error right before the crash:
Code:
L 07/03/2021 - 15:16:45: [DHOOKS] FATAL: Failed to find return address of original function. Check the arguments and return type of your detour setup.
Thank you, fixed.

Code:
1.45 (04-Jul-2021)
    - Fixed bad description for "L4D_SetHumanSpec" and "L4D_TakeOverBot" in the Include file.
    - L4D1: Fixed forward "L4D_OnVomitedUpon" crashing. GameData file updated. Thanks to "Crasher_3637" for reporting.
__________________
Silvers is offline
Alexmy
Senior Member
Join Date: Oct 2014
Location: Russian Federation
Old 07-04-2021 , 20:24   Re: [L4D & L4D2] Left 4 DHooks Direct (1.45) [04-Jul-2021]
Reply With Quote #360

What about creating a surviving bot via the SDK. Are you planning to add it in the future?
Alexmy 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 21:49.


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