View Single Post
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
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;

__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D

Last edited by Lux; 08-03-2019 at 16:33.
Lux is offline