// nummodels - 4
int nummodels = LoadFromAddress(view_as<Address>(pbodypart + 4), NumberType_Int32);
if(nummodels > iValue)
{
int base = LoadFromAddress(view_as<Address>(pbodypart + 8), NumberType_Int32);
body += (iValue - body / base % nummodels) * base;
}
}
}
}
CStudioHdr CBaseAnimating_GetModelPtr(int iEnt)
{
// CBaseAnimating::GetModelPtr - по нормальному нужно вызывать
// Но делаем так [url]https://github.com/qubka/Zombie-Plague/blob/67266c6b90d88180264745ccebff709531c722d0/gamedata/plugin.turret.txt#L8[/url]
static int iStudioHdrOffs = 0;
int iBody, int iGroups = pstudiohdr.GetNumBodyGroups();
for(int i = 0; i < iGroups; i++)
{
pstudiohdr.SetBodygroup(iBody, i, GetRandomInt(0, pstudiohdr.GetBodygroupCount(i) - 1));
}
SetEntProp(iEnt, Prop_Send, "m_nBody", iBody);
}
KoNLiG: For letting me scream at him while the code didn't work and crashed the server.
List of features:
Quote:
StudioHdr methodmap
Bones
• `GetBone()` - Get a specific bone object by index.
• `FindBone()` - Find bone index by name.
• Get model 'NumBones'.
Hitbox Sets
• `GetHitboxSet()` - Get a specific hitbox set object by index.
• Get model 'NumHitboxSets'.
Skin Families
• Get model 'SkinFamiliesCount'.
Spoiler
Body Parts
• `GetBodyPart()` - Get a specific body part object by index.
• `FindBodyPart()` - Find body part index by name.
• Get model 'NumBodyParts'.
Spoiler
Attachments
• `GetAttachment()` - Get a specific attachment object by index.
• `FindAttachment()` - Find an attachment index by name.
• Get model 'AttachmentCount'.
Spoiler
Pose Parameters
• `GetPoseParameter()` - Get a specific pose parameter object by index.
• `FindPoseParameter()` - Find a pose parameter index by name.
• Get model 'NumPoseParameters'.
Spoiler
Bone methodmap
• `GetName()` - Get the name of the body part.
• `GetPos()` - Get the position of the bone (relative to model).
Hitbox methodmap
• `bone` - The related bone of the specific hitbox.
• `group` - The intersection group of the specific hitbox. bounding box, or the ends of the capsule if flCapsuleRadius > 0
• `bbmin`
• `bbmax`
• `GetAngOffsetOrientation()` - Gets the angle offset orientation.
• `flCapsuleRadius` - The radius of the capsule (if not a capsule = 0.0)
HitboxSet methodmap
• `GetHitbox()` - Get a specific hitbox object by index.
• `NumHitboxs` - Number of hitboxes in the hitbox set.
BodyPart methodmap
• `GetName()` - Get the name of the body part.
• `base` - The base value of the body part.
• `nummodels` - Number of sub-models.
Spoiler
Attachment methodmap
• `GetName()` - Get the name of the attachment.
Pose Parameter methodmap
• `GetName()` - Get the name of the pose parameter.
• `start` - The minimum value of the pose parameter.
• `end` - The maximum value of the pose parameter.
Note:
This include was tested only in CS:GO (Linux).
This should work in any source engine based game (i am pretty sure).
If you want to support other games (and you can test), please write here below or add me on Discord!