Veteran Member
Join Date: Jan 2015
Location: Cat
|
04-18-2017
, 05:51
Re: [L4D/L4D2] Grenade Throwing Bots
|
#6
|
I suggest using my IsSurvivorThirdPerson()
because that will catch most things that would stop you from throwing anything.
Here i modded it abit so you could use it here, i'm not 100% sure.
Code:
static bool:IsSurvivorThirdPerson(iClient)
{
if(GetEntPropEnt(iClient, Prop_Send, "m_isIncapacitated") > 0)
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:
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:
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:
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:
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:
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:
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:
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:
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:
return true;
}
}
}
return false;
}
Also this has a check you missed
if(GetEntPropEnt(iClient, Prop_Send, "m_carryAttacker") > 0)
return true;
is missing from your IsInShape()
bool.
Be sure to convert to new syntax if you dislike my old syntax code.
enjoy
EXTRA:
GetEntPropEnt(client, Prop_Send, "m_tongueOwner") > 0
I don't use this because you can still throw stuff while is m_tongueOwner > 0
This will report back greater than 0 but you can still throw stuff, shoot and melee in the first second of being pulled, that is why i used sequences instead.
and
switch(GetEntProp(iClient, Prop_Send, "m_iCurrentUseAction"))
can be used for bot plugins Example "my bots use upgrade packs and other stuff", that would interfere with the bot plugins I use,
it's just a suggestion for compatibility with other plugins and more friendly to bots that are healing team mates
__________________
Last edited by Lux; 04-18-2017 at 06:03.
Reason: Why i did not use m_tongueOwner
|
|