Quote:
Originally Posted by Dragokas
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] = { 13284, 16008, 16128, 15976 }; for (int i = 0; i < sizeof(survivorProps); i++) { if (IsClientInGame(GetEntDataEnt2(survivor, survivorProps[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(client, Prop_Send, "m_pummelAttacker") > 0)
return true;
if(GetEntPropEnt(client, Prop_Send, "m_carryAttacker") > 0)
return true;
if(GetEntPropEnt(client, Prop_Send, "m_pounceAttacker") > 0)
return true;
if(GetEntPropEnt(client, Prop_Send, "m_jockeyAttacker") > 0)
return true;
if(GetEntPropEnt(client, Prop_Send, "m_tongueOwner") > 0)
return true;
return false;
}
less jnz's?
PHP Code:
stock bool L4D_IsPlayerCapped(int client)
{
if(GetEntPropEnt(client, Prop_Send, "m_pummelAttacker") > 0 ||
GetEntPropEnt(client, Prop_Send, "m_carryAttacker") > 0 ||
GetEntPropEnt(client, Prop_Send, "m_pounceAttacker") > 0 ||
GetEntPropEnt(client, Prop_Send, "m_jockeyAttacker") > 0 ||
GetEntPropEnt(client, Prop_Send, "m_pounceAttacker") > 0 ||
GetEntPropEnt(client, Prop_Send, "m_tongueOwner") > 0)
return true;
return false;
}
__________________