Raised This Month: $115 Target: $400
 28% 

[L4D/L4D2] Left 4 Dead (2) Include File (Last Updated: 04/21/2019)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 12-18-2017 , 14:39   [L4D/L4D2] Left 4 Dead (2) Include File (Last Updated: 04/21/2019)
Reply With Quote #1

An include file for the Left 4 Dead games, similar to how cstrike is for CSS and CSGO, tf2/tf2_stocks is for TF2, etc.

There's separate functions for survivor and infected indexes due to how indexes are different for both games.

Moved to the Sourcemod-Misc info around 04/21/2019.

Download | Github | Donate
__________________
My [Dev] Website | Discord: Drixevel#5049[/SIZE][/FONT]

Last edited by Drixevel; 04-21-2019 at 21:07.
Drixevel is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 04-21-2019 , 21:09   Re: [L4D/L4D2] Left 4 Dead (2) Include File (Last Updated: 04/21/2019)
Reply With Quote #2

Updated and moved to the Sourcemod-Resources repository on Github.
__________________
My [Dev] Website | Discord: Drixevel#5049[/SIZE][/FONT]
Drixevel is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Old 08-02-2019 , 12:20   Re: [L4D/L4D2] Left 4 Dead (2) Include File (Last Updated: 04/21/2019)
Reply With Quote #3

Thank you!

Can you please describe more, what does that mean?

PHP Code:
/**
 * Checks if the survivor is capped.
 *
 * @param client    Players index.
 * @return            True if the player is capped, false otherwise.
 */
stock bool L4D_IsPlayerCapped(int client)
{
    
int survivorProps[4] = { 13284160081612815976 };
    
    for (
int i 0sizeof(survivorProps); i++)
    {
        if (
IsClientInGame(GetEntDataEnt2(survivorsurvivorProps[i])))
            return 
true;
    }
    
    return 
false;

__________________
Expert of CMD/VBS/VB6. Malware analyst.
[My plugins] [My tools] [GitHub]
Dragokas is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Brexit
Old 08-03-2019 , 16:32   Re: [L4D/L4D2] Left 4 Dead (2) Include File (Last Updated: 04/21/2019)
Reply With Quote #4

Quote:
Originally Posted by Dragokas View Post
Thank you!

Can you please describe more, what does that mean?

PHP Code:
/**
 * Checks if the survivor is capped.
 *
 * @param client    Players index.
 * @return            True if the player is capped, false otherwise.
 */
stock bool L4D_IsPlayerCapped(int client)
{
    
int survivorProps[4] = { 13284160081612815976 };
    
    for (
int i 0sizeof(survivorProps); i++)
    {
        if (
IsClientInGame(GetEntDataEnt2(survivorsurvivorProps[i])))
            return 
true;
    }
    
    return 
false;

It reads if they are being dominated by specials e.g. smoked charged jockeyed and pounded.

You should just get the offsets and cache them in a static when called because the offsets could change altho it would be very rare for l4d but still a better habbit or just use GetEntPropEnt as that uses a hashmap iirc.

How I do it much more understanding.
https://github.com/LuxLuma/Luxs-Mode...t.sp#L158-L165


The carry attacker is not included in his bool i think it should.
PHP Code:
stock bool L4D_IsPlayerCapped(int client)
{
    if(
GetEntPropEnt(clientProp_Send"m_pummelAttacker") > 0)
        return 
true;
    if(
GetEntPropEnt(clientProp_Send"m_carryAttacker") > 0)
        return 
true;
    if(
GetEntPropEnt(clientProp_Send"m_pounceAttacker") > 0)
        return 
true;
    if(
GetEntPropEnt(clientProp_Send"m_jockeyAttacker") > 0)
        return 
true;
    if(
GetEntPropEnt(clientProp_Send"m_tongueOwner") > 0)
        return 
true;
    
    return 
false;

less jnz's?
PHP Code:
stock bool L4D_IsPlayerCapped(int client)
{
    if(
GetEntPropEnt(clientProp_Send"m_pummelAttacker") > || 
        
GetEntPropEnt(clientProp_Send"m_carryAttacker") > || 
        
GetEntPropEnt(clientProp_Send"m_pounceAttacker") > || 
        
GetEntPropEnt(clientProp_Send"m_jockeyAttacker") > || 
        
GetEntPropEnt(clientProp_Send"m_pounceAttacker") > ||
        
GetEntPropEnt(clientProp_Send"m_tongueOwner") > 0)
        return 
true;
    return 
false;

__________________

Last edited by Lux; 08-03-2019 at 16:33.
Lux is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Old 08-03-2019 , 16:38   Re: [L4D/L4D2] Left 4 Dead (2) Include File (Last Updated: 04/21/2019)
Reply With Quote #5

Ahh, understand, thank you.
__________________
Expert of CMD/VBS/VB6. Malware analyst.
[My plugins] [My tools] [GitHub]
Dragokas is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 08-25-2019 , 14:14   Re: [L4D/L4D2] Left 4 Dead (2) Include File (Last Updated: 04/21/2019)
Reply With Quote #6

Pushed a change to the l4d.inc file to change the method used to detect if you're capped by Lux.
__________________
My [Dev] Website | Discord: Drixevel#5049[/SIZE][/FONT]
Drixevel 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 22:47.


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