AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Playing Player Model's Sequence (https://forums.alliedmods.net/showthread.php?t=320241)

allame61 12-11-2019 15:27

Playing Player Model's Sequence
 
hi i wanna play the sequence of player model in x public can someone help ?

redivcram 12-11-2019 19:44

Re: Playing Player Model's Sequence
 
What?

allame61 12-12-2019 01:00

Re: Playing Player Model's Sequence
 
e.g when player is walking, i wanna play the new animation for the player's model

@redivcram

DjSoftero 12-12-2019 02:31

Re: Playing Player Model's Sequence
 
try searching. I believe it has been answered before.

thEsp 12-12-2019 14:02

Re: Playing Player Model's Sequence
 
I believe the only way to do that is by registering, setting and blocking sequence index on CBasePlayer::SetAnimation() via Orpheu.
https://forums.alliedmods.net/showthread.php?p=2282672

allame61 12-12-2019 15:02

Re: Playing Player Model's Sequence
 
It seems hard to me , I dont know orpheu module

HamletEagle 12-12-2019 15:31

Re: Playing Player Model's Sequence
 
Quote:

Originally Posted by thEsp (Post 2676732)
I believe the only way to do that is by registering, setting and blocking sequence index on CBasePlayer::SetAnimation() via Orpheu.
https://forums.alliedmods.net/showthread.php?p=2282672

Nope, orpheu will not work for this specific function for the reasons explained in the topic you linked(which also provides a solution).

allame61 12-20-2019 02:11

Re: Playing Player Model's Sequence
 
if i change animations name in model and play animation, does it work ?

allame61 12-20-2019 05:50

Re: Playing Player Model's Sequence
 
Should it work ?

@HamletEagle
@thEsp

Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>



public plugin_init()
{
        register_plugin("[ZP] Addon: Custom Anim", "1.0", "xyUnicorn");


          RegisterHam(Ham_Player_Jump, "player", "Fwd_JumpCount", 1)
}

stock UTIL_PlayerAnimation(const iPlayer, const szAnim[])
{

    // Linux extra offsets
    #define linux_diff_animating 4
    #define linux_diff_player 5
  #define ACT_HOP 1
    // CBaseAnimating
    #define m_flFrameRate 36
    #define m_flGroundSpeed 37
    #define m_flLastEventCheck 38
    #define m_fSequenceFinished 39
    #define m_fSequenceLoops 40

    // CBaseMonster
    #define m_Activity 73
    #define m_IdealActivity 74

 

    new iAnimDesired, Float: flFrameRate, Float: flGroundSpeed, bool: bLoops;
       
    if((iAnimDesired = lookup_sequence(iPlayer, szAnim, flFrameRate, bLoops, flGroundSpeed)) == -1)
    {
        iAnimDesired = 0;
    }
   
    new Float: flGameTime = get_gametime();

    set_pev(iPlayer, pev_frame, 0.0);
    set_pev(iPlayer, pev_framerate, 1.0);
    set_pev(iPlayer, pev_animtime, flGameTime);
    set_pev(iPlayer, pev_sequence, iAnimDesired);
   
    set_pdata_int(iPlayer, m_fSequenceLoops, bLoops, linux_diff_animating);
    set_pdata_int(iPlayer, m_fSequenceFinished, 0, linux_diff_animating);
   
    set_pdata_float(iPlayer, m_flFrameRate, flFrameRate, linux_diff_animating);
    set_pdata_float(iPlayer, m_flGroundSpeed, flGroundSpeed, linux_diff_animating);
    set_pdata_float(iPlayer, m_flLastEventCheck, flGameTime , linux_diff_animating);
   
    set_pdata_int(iPlayer, m_Activity, ACT_HOP, linux_diff_player);
    set_pdata_int(iPlayer, m_IdealActivity, ACT_HOP, linux_diff_player);
}

public Fwd_JumpCount(id,iPlayer)
{
        // Linux extra offsets
        #define linux_diff_weapon 4
        #define linux_diff_animating 4
        #define linux_diff_player 5


        // CBasePlayer
        #define m_szAnimExtention 492
        UTIL_PlayerAnimation(iPlayer,"jump3")


        set_pdata_string(iPlayer, m_szAnimExtention * 4, "jump3", -1, linux_diff_player * linux_diff_animating);
}


allame61 12-21-2019 09:45

Re: Playing Player Model's Sequence
 
can you give me a example when player is running i wanna put new sequence on that activity

@HamletEagle


All times are GMT -4. The time now is 00:00.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.