AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Module Coding (https://forums.alliedmods.net/forumdisplay.php?f=9)
-   -   [HELP] Writing a module hooking CBasePlayer::SetAnimation (https://forums.alliedmods.net/showthread.php?t=261384)

wiwi249 04-11-2015 14:02

[HELP] Writing a module hooking CBasePlayer::SetAnimation
 
Hello.
After a lot of trying with orpheu in this topic: https://forums.alliedmods.net/showthread.php?p=2282651 I've decided to write a new module to hook the CBasePlayer::SetAnimation, because it's the last thing I can do in that case. The problem is, that I've never written a module. I've got basic knowledge in C++ though. So:
1. Is there any tutorial or something written to help me learn module coding? I've been trying to search the forum but I didn't find it. Or maybe is there some basic code I can use to learn on (I don't need much, that will do).
2. How to hook the CBasePlayer::SetAnimation event in my module? In amxx it was (almost) all about byte signature in orpheu. How to make it with a module only?
3. How to make an AMXX Forward based on the functions I want to hook? If I "hook" this function, I think that I should make a hookable forward with AMXX and then supercede it (that's what I need to do, unfortunately). If you have any other ideas, can you tell me?

Thanks in advance and sorry for a problem. I just need to hook this function finally.

Bos93 04-11-2015 14:37

Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
 
Are you sure you need it?

https://forums.alliedmods.net/showpo...87&postcount=2

wiwi249 04-11-2015 17:25

Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
 
Yes, I'm pretty sure.
Check the link I've provided in the first post. HLDS has been updated and It's much harder to hook it now.

wiwi249 04-12-2015 06:15

Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
 
Alright, an update.
I've managed to open the example module (dod_mm) and find a tutorial.
It seems to make sense ;)
Now how to hook the SetAnimation functions?

HamletEagle 04-12-2015 06:29

Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
 
Maybe look at how orpheu or okapi does that ? It may help, idk.

wiwi249 04-12-2015 07:22

Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
 
I was trying to understand how Arkshine did it in the AdminFreeLook module ( https://github.com/Arkshine/AdminFre.../master/module ), but I don't understand shit. I think I have to wait until he explains something.
By the way, Orpheu is much more complicated, especially that it hooks functions registered in signatures and used in plugins. I just cant get to read that thing in the code and I dont know what is what in the Orpheu source.

Arkshine 04-14-2015 06:27

Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
 
2 Attachment(s)
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.

wiwi249 04-14-2015 13:24

Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
 
It's just impossible not to love Arkshine! Thank you master, I'll give it a try tommorow.
For now, do you know what's the animations limit per 1 model? I remember that it was somewhere in SDK but I cant find it now :/

Arkshine 04-14-2015 13:27

Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
 
Please define "animation limit per 1 model" ; I have no idea what it means.

wiwi249 04-14-2015 13:47

Re: [HELP] Writing a module hooking CBasePlayer::SetAnimation
 
I mean how many animations can one mdl file contain. (Player models have something like 117 animations if I remember well).


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

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