alliedmodders / sourcemod

SourceMod - Source Engine Scripting and Administration
http://www.sourcemod.net/
975 stars 422 forks source link

Left 4 Dead 2, Sourcemod, setparent bones for survivors #925

Closed MozillaFiref0x closed 5 years ago

MozillaFiref0x commented 5 years ago

Hello! Could you help me? I am trying to restore the Smod plugin DeathChaos25, where he parented his legs with the world player model. He set "bleedout". Tell me - how can you parenting the legs to the center of the model without rotating the yaw angle and rotating it while the character is moving.

P.S. "!activator" - its bad idea. I can't turn off yaw angle rotation. P.S.S. Sorry for bad english :)

Code:


decl Float:vAngles[3];
decl Float:vOrigin[3];
GetClientAbsOrigin(client, vOrigin);
GetClientAbsAngles(client, vAngles);
decl String:playerModel[128];
GetEntPropString(client, Prop_Data, "m_ModelName", playerModel, sizeof(playerModel));

new clone = CreateEntityByName("prop_dynamic_override");
SetEntityModel(clone, playerModel);

SetEntProp(clone, Prop_Data, "m_CollisionGroup", 2);
decl String:sTemp[16];
Format(sTemp, sizeof(sTemp), "target%d", client);
DispatchKeyValue(client, "targetname", sTemp);
SetVariantString(sTemp);
AcceptEntityInput(clone, "SetParent", clone, clone, 0);

SetVariantString("bleedout"); //pistol legL
AcceptEntityInput(clone, "SetParentAttachment");

//TeleportEntity(clone, vOrigin, vAngles, NULL_VECTOR);
SetEntPropFloat(clone, Prop_Send, "m_flPlaybackRate", GetEntPropFloat(client, Prop_Send, "m_flPlaybackRate"));
SetEntData(clone, PropOff_nSequence, sequence);

//SetEntProp(client, Prop_Send, "m_bDrawViewmodel", 0);
//SetEntityRenderMode(client, RENDER_NONE);
CloneModel[client] = clone;
//ang -80 0 -90
//pos -10 -40 -20
new Float:pos[3], Float:ang[3];
ang[0] = -0.0;
ang[1] = 90.0;
ang[2] = -90.0;

pos[0] = -10.0;
pos[1] = -40.0;
pos[2] = -20.0;
TeleportEntity(CloneModel[client], pos, ang, NULL_VECTOR);

MozillaFiref0x commented 5 years ago

If you tell me all parent bones - it would be great!

KyleSanderson commented 5 years ago

Please post on the forums; this is not a product issue.

MozillaFiref0x commented 5 years ago

Sorry

KyleSanderson commented 5 years ago

No need to be sorry bud; glad you're using the platform ;-)