Skip to content

Commit

Permalink
More simple ragdolls
Browse files Browse the repository at this point in the history
  • Loading branch information
LuxLuma committed Feb 10, 2019
1 parent d2b9556 commit bc7938e
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions addons/sourcemod/scripting/LMCEDeathHandler.sp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


#define PLUGIN_NAME "LMCEDeathHandler"
#define PLUGIN_VERSION "1.1"
#define PLUGIN_VERSION "1.1.1"


public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
Expand Down Expand Up @@ -61,35 +61,7 @@ public void ePlayerDeath(Handle hEvent, const char[] sEventName, bool bDontBroad

void NextBotRagdollHandler(int iEntity, int iPreRagdoll)
{
AcceptEntityInput(iPreRagdoll, "Kill");

int iRagdoll = CreateEntityByName("cs_ragdoll");
if(iRagdoll < 1)
return;

if(iRagdoll >= 2000)
{
RemoveEdict(iRagdoll);
PrintToServer("[LMC]Removing edict[%i] for entity ragdolls to prevent crashing using parent's ragdoll", iRagdoll);
return;
}

float fPos[3];
float fAng[3];
GetEntPropVector(iEntity, Prop_Data, "m_vecOrigin", fPos);
GetEntPropVector(iEntity, Prop_Data, "m_angRotation", fAng);
TeleportEntity(iRagdoll, fPos, fAng, NULL_VECTOR);

SetEntProp(iRagdoll, Prop_Send, "m_nModelIndex", GetEntProp(iPreRagdoll, Prop_Send, "m_nModelIndex", 2), 2);
SetEntProp(iRagdoll, Prop_Send, "m_iTeamNum", 3, 1);
SetEntProp(iRagdoll, Prop_Send, "m_hPlayer", -1, 3);
SetEntProp(iRagdoll, Prop_Send, "m_ragdollType", 1, 1);
SetEntProp(iRagdoll, Prop_Send, "m_bOnFire", GetEntProp(iEntity, Prop_Send, "m_bIsBurning", 1), 1);

SetVariantString("OnUser1 !self:Kill::0.1:1");
AcceptEntityInput(iRagdoll, "AddOutput");
AcceptEntityInput(iRagdoll, "FireUser1");

AcceptEntityInput(iPreRagdoll, "BecomeRagdoll");
SDKHook(iEntity, SDKHook_SetTransmit, HideNextBot);
}

Expand Down

0 comments on commit bc7938e

Please sign in to comment.