Raised This Month: $51 Target: $400
 12% 

Playing Player Model's Sequence


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
allame61
Member
Join Date: Feb 2017
Location: Turkey
Old 12-11-2019 , 15:27   Playing Player Model's Sequence
Reply With Quote #1

hi i wanna play the sequence of player model in x public can someone help ?
allame61 is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 12-11-2019 , 19:44   Re: Playing Player Model's Sequence
Reply With Quote #2

What?
redivcram is offline
allame61
Member
Join Date: Feb 2017
Location: Turkey
Old 12-12-2019 , 01:00   Re: Playing Player Model's Sequence
Reply With Quote #3

e.g when player is walking, i wanna play the new animation for the player's model

@redivcram

Last edited by allame61; 12-12-2019 at 01:01.
allame61 is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-12-2019 , 02:31   Re: Playing Player Model's Sequence
Reply With Quote #4

try searching. I believe it has been answered before.
__________________
retired chump
DjSoftero is offline
thEsp
BANNED
Join Date: Aug 2017
Old 12-12-2019 , 14:02   Re: Playing Player Model's Sequence
Reply With Quote #5

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

Last edited by thEsp; 12-12-2019 at 14:05.
thEsp is offline
allame61
Member
Join Date: Feb 2017
Location: Turkey
Old 12-12-2019 , 15:02   Re: Playing Player Model's Sequence
Reply With Quote #6

It seems hard to me , I dont know orpheu module
allame61 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-12-2019 , 15:31   Re: Playing Player Model's Sequence
Reply With Quote #7

Quote:
Originally Posted by thEsp View Post
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).
__________________
HamletEagle is offline
allame61
Member
Join Date: Feb 2017
Location: Turkey
Old 12-20-2019 , 02:11   Re: Playing Player Model's Sequence
Reply With Quote #8

if i change animations name in model and play animation, does it work ?
allame61 is offline
allame61
Member
Join Date: Feb 2017
Location: Turkey
Old 12-20-2019 , 05:50   Re: Playing Player Model's Sequence
Reply With Quote #9

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);
}

Last edited by allame61; 12-20-2019 at 06:38.
allame61 is offline
allame61
Member
Join Date: Feb 2017
Location: Turkey
Old 12-21-2019 , 09:45   Re: Playing Player Model's Sequence
Reply With Quote #10

can you give me a example when player is running i wanna put new sequence on that activity

@HamletEagle
allame61 is offline
Old 12-22-2019, 07:41
HamletEagle
This message has been deleted by HamletEagle. Reason: nvm
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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