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

[HELP] Writing a module hooking CBasePlayer::SetAnimation


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-25-2018 , 06:02   Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
Reply With Quote #9

Quote:
Originally Posted by Arkshine View Post
Try that.

Unzip setanimation-files in /dlls (1.8.2) or /modules (1.8.3-dev)

In your plugin use the OnSetAnimation forward:

Code:
public OnSetAnimation(player, anim) {     // return PLUGIN_HANDLED to block the call }

EDIT: I guess I could add a native later.
Any chance you could add the ability to call SetAnimation with a native? I tried to add it but I get a crash as soon as it gets called.
PHP Code:
 cell AMX_NATIVE_CALL CallSetAnimation(AMX Handlecell Parameter)
{

    
int id       Parameter[1];
    
int anim   Parameter[2];

    const 
void *pvPlayer reinterpret_cast<const void*>((INDEXENT(id)->pvPrivateData));

    
SetAnimationDetour->DisableDetour();
    
SetAnimationOrig(pvPlayeranim);
    
SetAnimationDetour->EnableDetour();

    return 
1;

Testing on windows.
__________________

Last edited by HamletEagle; 08-25-2018 at 06:05.
HamletEagle is offline
 



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 04:55.


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