Raised This Month: $32 Target: $400
 8% 

Model Animation


Post New Thread Reply   
 
Thread Tools Display Modes
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-15-2018 , 17:35   Re: Model Animation
Reply With Quote #11

Quote:
Originally Posted by Ghosted View Post
animtime is when animation started. at set_task you dont need to reSet sequence id, only animtime would be enough. for so in task call you should only use animtime = gametime
I didn't really understand what you meant, sorry.. This?
PHP Code:
public MakeAnimid 

    
Util_PlayAnimationididle4.7 );
    
    
set_task4.7"@RenewAnimation"id, .flags="b" ); 


@
RenewAnimationid 

    
entity_set_float(idEV_FL_animtimeget_gametime( ));  


stock Util_PlayAnimation(indexsequenceFloatframerate 1.0)  
{  
    
entity_set_float(indexEV_FL_animtimeget_gametime());  
    
entity_set_float(indexEV_FL_framerate,  framerate);  
    
entity_set_float(indexEV_FL_frame0.0);  
    
entity_set_int(indexEV_INT_sequencesequence);  

__________________
edon1337 is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-16-2018 , 05:29   Re: Model Animation
Reply With Quote #12

that should work
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-16-2018 , 05:44   Re: Model Animation
Reply With Quote #13

Quote:
Originally Posted by Ghosted View Post
that should work
Tested but didn't work, doesn't change the default animation
__________________
edon1337 is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-16-2018 , 06:54   Re: Model Animation
Reply With Quote #14

Quote:
Originally Posted by edon1337 View Post
Tested but didn't work, doesn't change the default animation
If you tried on player i think it wont work this is for custom entities.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-16-2018 , 07:30   Re: Model Animation
Reply With Quote #15

Quote:
Originally Posted by Ghosted View Post
If you tried on player i think it wont work this is for custom entities.
What can I do for normal players?
__________________
edon1337 is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-16-2018 , 07:47   Re: Model Animation
Reply With Quote #16

I can't find code written in pawn this is for C++ and works (I don't know well setting animations on players)
Spoiler
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 08-16-2018 at 07:48.
Ghosted is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-16-2018 , 12:00   Re: Model Animation
Reply With Quote #17

I'll try this. https://forums.alliedmods.net/showpo...22&postcount=2
__________________
edon1337 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-17-2018 , 07:42   Re: Model Animation
Reply With Quote #18

I made this but it just crashes my server, most likely because SetAnimation is split into 2 functions in Linux, one that handles weapon-related animations (SetAnimation) and the other which handles player-related animations (SetAnimation_part2)..

PHP Code:
public plugin_init( )
{
    
OrpheuRegisterHookOrpheuGetFunction"SetAnimation2" ), "OnSetAnimation2"OrpheuHookPre );
}

public 
OrpheuHookReturn:OnSetAnimation2( const id, const PlayerAnim:pAnimation )
{
    if( ! 
is_user_aliveid ) )
    return 
OrpheuIgnored;
    
    
set_pevidpev_animtimeget_gametime( ) );
    
set_pevidpev_sequenceidle );
    
set_pevidpev_frame0.0 );
    
set_pevidpev_framerate1.0 );
    
    return 
OrpheuIgnored;

__________________
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-17-2018 , 07:50   Re: Model Animation
Reply With Quote #19

Quote:
Originally Posted by edon1337 View Post
I made this but it just crashes my server, most likely because SetAnimation is split into 2 functions in Linux, one that handles weapon-related animations (SetAnimation) and the other which handles player-related animations (SetAnimation_part2)..

PHP Code:
public plugin_init( )
{
    
OrpheuRegisterHookOrpheuGetFunction"SetAnimation2" ), "OnSetAnimation2"OrpheuHookPre );
}

public 
OrpheuHookReturn:OnSetAnimation2( const id, const PlayerAnim:pAnimation )
{
    if( ! 
is_user_aliveid ) )
    return 
OrpheuIgnored;
    
    
set_pevidpev_animtimeget_gametime( ) );
    
set_pevidpev_sequenceidle );
    
set_pevidpev_frame0.0 );
    
set_pevidpev_framerate1.0 );
    
    return 
OrpheuIgnored;

If you read this you should also know that hooking this function was already tried and it crashes. Arkshine made a module to hook it.
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-17-2018 , 09:09   Re: Model Animation
Reply With Quote #20

Quote:
Originally Posted by HamletEagle View Post
If you read this you should also know that hooking this function was already tried and it crashes. Arkshine made a module to hook it.
Found it, thnx.
What do I use to over-write the current animation?
__________________

Last edited by edon1337; 08-17-2018 at 09:09.
edon1337 is offline
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 18:39.


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