Veteran Member
Join Date: Jan 2015
Location: Cat
|
07-01-2017
, 16:47
[L4D2]IsThirdPerson bools
|
#1
|
Hello, i should of done this a while ago but here are my 2 bools that i use to detect when a client is thirdperson.
PHP Code:
static bool:IsSurvivorThirdPerson(iClient)
{
if(GetEntPropEnt(iClient, Prop_Send, "m_hViewEntity") > 0)
return true;
if(GetEntPropFloat(iClient, Prop_Send, "m_TimeForceExternalView") > GetGameTime())
return true;
if(GetEntProp(iClient, Prop_Send, "m_iObserverMode") == 1)
return true;
if(GetEntPropEnt(iClient, Prop_Send, "m_pummelAttacker") > 0)
return true;
if(GetEntPropEnt(iClient, Prop_Send, "m_carryAttacker") > 0)
return true;
if(GetEntPropEnt(iClient, Prop_Send, "m_pounceAttacker") > 0)
return true;
if(GetEntPropEnt(iClient, Prop_Send, "m_jockeyAttacker") > 0)
return true;
if(GetEntProp(iClient, Prop_Send, "m_isHangingFromLedge") > 0)
return true;
if(GetEntPropEnt(iClient, Prop_Send, "m_reviveTarget") > 0)
return true;
if(GetEntPropFloat(iClient, Prop_Send, "m_staggerTimer", 1) > -1.0)
return true;
switch(GetEntProp(iClient, Prop_Send, "m_iCurrentUseAction"))
{
case 1:
{
static iTarget;
iTarget = GetEntPropEnt(iClient, Prop_Send, "m_useActionTarget");
if(iTarget == GetEntPropEnt(iClient, Prop_Send, "m_useActionOwner"))
return true;
else if(iTarget != iClient)
return true;
}
case 4, 6, 7, 8, 9, 10:
return true;
}
static String:sModel[31];
GetEntPropString(iClient, Prop_Data, "m_ModelName", sModel, sizeof(sModel));
switch(sModel[29])
{
case 'b'://nick
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 626, 625, 624, 623, 622, 621, 661, 662, 664, 665, 666, 667, 668, 670, 671, 672, 673, 674, 620, 680, 616:
return true;
}
}
case 'd'://rochelle
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 674, 678, 679, 630, 631, 632, 633, 634, 668, 677, 681, 680, 676, 675, 673, 672, 671, 670, 687, 629, 625, 616:
return true;
}
}
case 'c'://coach
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 656, 622, 623, 624, 625, 626, 663, 662, 661, 660, 659, 658, 657, 654, 653, 652, 651, 621, 620, 669, 615:
return true;
}
}
case 'h'://ellis
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 625, 675, 626, 627, 628, 629, 630, 631, 678, 677, 676, 575, 674, 673, 672, 671, 670, 669, 668, 667, 666, 665, 684, 621:
return true;
}
}
case 'v'://bill
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 528, 759, 763, 764, 529, 530, 531, 532, 533, 534, 753, 676, 675, 761, 758, 757, 756, 755, 754, 527, 772, 762, 522:
return true;
}
}
case 'n'://zoey
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 537, 819, 823, 824, 538, 539, 540, 541, 542, 543, 813, 828, 825, 822, 821, 820, 818, 817, 816, 815, 814, 536, 809, 572:
return true;
}
}
case 'e'://francis
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 532, 533, 534, 535, 536, 537, 769, 768, 767, 766, 765, 764, 763, 762, 761, 760, 759, 758, 757, 756, 531, 530, 775, 525:
return true;
}
}
case 'a'://louis
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 529, 530, 531, 532, 533, 534, 766, 765, 764, 763, 762, 761, 760, 759, 758, 757, 756, 755, 754, 753, 527, 772, 528, 522:
return true;
}
}
case 'w'://adawong
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 674, 678, 679, 630, 631, 632, 633, 634, 668, 677, 681, 680, 676, 675, 673, 672, 671, 670, 687, 629, 625:
return true;
}
}
}
return false;
}
PHP Code:
static bool:IsInfectedThirdPerson(iClient)
{
if(GetEntPropFloat(iClient, Prop_Send, "m_TimeForceExternalView") > GetGameTime())
return true;
if(GetEntPropFloat(iClient, Prop_Send, "m_staggerTimer", 1) > -1.0)
return true;
switch(GetEntProp(iClient, Prop_Send, "m_zombieClass"))
{
case 1://smoker
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 30, 31, 32, 36, 37, 38, 39:
return true;
}
}
case 2://boomer
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 30, 31, 32, 33:
return true;
}
}
case 3://hunter
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49:
return true;
}
}
case 4://spitter
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 17, 18, 19, 20:
return true;
}
}
case 5://jockey
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 8 , 15, 16, 17, 18:
return true;
}
}
case 6://charger
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 5, 27, 28, 29, 31, 32, 33, 34, 35, 39, 40, 41, 42:
return true;
}
}
case 8://tank
{
switch(GetEntProp(iClient, Prop_Send, "m_nSequence"))
{
case 28, 29, 30, 31, 49, 50, 51, 73, 74, 75, 76 ,77:
return true;
}
}
}
return false;
}
If you have any improvments please let me know.
__________________
|
|