Quote:
Originally Posted by Natsheh
the p_weapon model has no animations are you talking about the player model animation?
|
Yeah, i've seen something in T3rkecorejz's take on Stormgiant Warhammer where he has something like this:
Code:
static szAnimation[32];
format(szAnimation, charsmax(szAnimation), pev(pPlayer, pev_flags) & FL_DUCKING ? "crouch_shoot_%s" : "ref_shoot_%s", STORMGIANT_PLAYER_SEQUENCE);
UTIL_PlayerAnimation(pPlayer, szAnimation, 93.0); // Note: STORMGIANT_PLAYER_SEQUENCE is "skullaxe"
Code:
public UTIL_PlayerAnimation(pPlayer, szAnimation[], Float:iFrame) { // By KORD_12.7
static iAnimDesired, Float:flFrameRate, Float:flGroundSpeed, bool:bLoops;
if((iAnimDesired = lookup_sequence(pPlayer, szAnimation, flFrameRate, bLoops, flGroundSpeed)) == -1) iAnimDesired = 0;
static Float:flGameTime; flGameTime = get_gametime();
set_pev(pPlayer, pev_frame, iFrame);
set_pev(pPlayer, pev_framerate, 1.0);
set_pev(pPlayer, pev_animtime, flGameTime);
set_pev(pPlayer, pev_sequence, iAnimDesired);
set_pdata_int(pPlayer, m_fSequenceLoops, bLoops, 4);
set_pdata_int(pPlayer, m_fSequenceFinished, 0, 4);
set_pdata_float(pPlayer, m_flFrameRate, flFrameRate, 4);
set_pdata_float(pPlayer, m_flGroundSpeed, flGroundSpeed, 4);
set_pdata_float(pPlayer, m_flLastEventCheck, flGameTime, 4);
set_pdata_int(pPlayer, m_Activity, ACT_RANGE_ATTACK1, 5);
set_pdata_int(pPlayer, m_IdealActivity, ACT_RANGE_ATTACK1, 5);
set_pdata_float(pPlayer, m_flLastAttackTime, flGameTime, 5);
}
// ACT_RANGE_ATTACK1 is 28
And then i started asking myself up about this and how it is possible so i came to the conclusion that whenever a new p_ model is added to the player it adds along with it new player animation for the model.