Hi i been searching for a way to add the crawling anim directly, this is how far i came,
however the client crawling can see the crawl anim but the other clients can just see sliding not sure how to go from here.
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
public OnPluginStart()
{
for(new i = 1; i <= MaxClients; i++)
{
if(!IsClientInGame(i) || IsFakeClient(i))
continue;
SDKHook(i, SDKHook_PostThinkPost, Hook_OnPostThinkPost);
}
}
public OnPluginEnd()
{
for(new i = 1; i <= MaxClients; i++)
{
if(!IsClientInGame(i) || IsFakeClient(i))
continue;
SDKUnhook(i, SDKHook_PostThinkPost, Hook_OnPostThinkPost);
}
}
public OnClientPutInServer(iClient)
{
if(IsFakeClient(iClient))
return;
SDKHook(iClient, SDKHook_PostThinkPost, Hook_OnPostThinkPost);
}
public OnClientDisconnect(iClient)
{
if(IsFakeClient(iClient))
return;
SDKUnhook(iClient, SDKHook_PostThinkPost, Hook_OnPostThinkPost);
}
public Hook_OnPostThinkPost(iClient)
{
if(GetClientTeam(iClient) != 2 || !IsPlayerAlive(iClient))
return;
if(!GetEntProp(iClient, Prop_Send, "m_isIncapacitated", 1))
{
SetEntProp(iClient, Prop_Send, "m_bClientSideAnimation", 1, 1);
return;
}
if(!(GetClientButtons(iClient) & IN_FORWARD))
return;
if(IsSurvivorBusy(iClient))
return;
static String:sModel[31];
GetEntPropString(iClient, Prop_Data, "m_ModelName", sModel, sizeof(sModel));
switch(sModel[29])
{
case 'b'://nick
{
SetEntProp(iClient, Prop_Send, "m_nSequence", 631, 2);
}
case 'd'://rochelle
{
SetEntProp(iClient, Prop_Send, "m_nSequence", 636, 2);
}
case 'c'://coach
{
return;
}
case 'h'://ellis
{
SetEntProp(iClient, Prop_Send, "m_nSequence", 639, 2);
}
case 'v'://bill
{
SetEntProp(iClient, Prop_Send, "m_nSequence", 539, 2);
}
case 'n'://zoey
{
SetEntProp(iClient, Prop_Send, "m_nSequence", 529, 2);
}
case 'e'://francis
{
SetEntProp(iClient, Prop_Send, "m_nSequence", 542, 2);
}
case 'a'://louis
{
SetEntProp(iClient, Prop_Send, "m_nSequence", 539, 2);
}
case 'w'://adawong
{
SetEntProp(iClient, Prop_Send, "m_nSequence", 636, 2);
}
}
//static Float:fTime[MAXPLAYERS+1];
//if(fTime[iClient] < GetEngineTime())
//{
// SetEntPropFloat(iClient, Prop_Send, "m_fServerAnimStartTime", GetGameTime());
// fTime[iClient] = GetEngineTime() + 1;
//}
SetEntPropFloat(iClient, Prop_Send, "m_flPlaybackRate", 1.0);
SetEntPropFloat(iClient, Prop_Send, "m_flCycle", FloatFraction(GetGameTime()));
SetEntProp(iClient, Prop_Send, "m_bClientSideAnimation", 0, 1);
//SetEntProp(iClient, Prop_Send, "m_bClientSideFrameReset", 1, 1);
//new Float:iEntProp = GetEntPropFloat(iClient, Prop_Send, "m_flCycle");
//PrintToChat(iClient, "m_flCycle = %f", iEntProp);
}
static bool:IsSurvivorBusy(iClient)
{
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_reviveOwner") > 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, 616:
return true;
}
}
}
return false;
}