Raised This Month: $ Target: $400
 0% 

TakeDamage from Monster


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
schirodes
Junior Member
Join Date: Sep 2008
Old 10-26-2014 , 17:11   TakeDamage from Monster
Reply With Quote #1

Sorry for my english, i'm from Argentina!

Hi! I want to catch when Monster attack a Player..

I tried whit Ham, and whit Orpheu (but Orpheu use the call of Ham if I didn't understand bad..), but i can't, I read all the post including this: https://forums.alliedmods.net/showth...7521?p=1087521

And couldn't!

This is TakeDamage of Orpheu I use:

PHP Code:
{
    
"name" "TakeDamage",
    
"class" "CBasePlayer"
    
"library" "mod",
    
"arguments" :
    [
        {
            
"type" "entvars_s *"
        
},
        {
            
"type" "entvars_s *"
        
},
        {
            
"type" "float"
        
},
        {
            
"type" "int"
        
}
    ],
    
"indexes" :
    [
        {
            
"os" "windows",
            
"mod" "cstrike",
            
"value" 12
        
},
        {
            
"os" "linux",
            
"mod" "cstrike",
            
"value" 14
        
}
    ]

schirodes is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-26-2014 , 17:55   Re: TakeDamage from Monster
Reply With Quote #2

Monster is vague. MonsterMod? Monster from HL1? Other? You should anyway use Ham as it's the same.
__________________
Arkshine is offline
schirodes
Junior Member
Join Date: Sep 2008
Old 10-26-2014 , 17:56   Re: TakeDamage from Monster
Reply With Quote #3

MonsterMod (by Botman) in Cs 1.6
schirodes is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-26-2014 , 17:59   Re: TakeDamage from Monster
Reply With Quote #4

Are you saying that just by hooking TakeDamage on "player", without filtering inside (just one line to show debug text), if a monster attacks a player, this forward is never called?
__________________

Last edited by Arkshine; 10-26-2014 at 17:59.
Arkshine is offline
schirodes
Junior Member
Join Date: Sep 2008
Old 10-26-2014 , 18:04   Re: TakeDamage from Monster
Reply With Quote #5

Yes, when Monster attack Player, not show results
Code:

PHP Code:
public fwd_HamTakeDamageiClientiInflictoriAttackerFloat:fDamagem_Damagebits )
{
    
client_print(0,print_chat,"%d entity was damaged by %d attacker with %f points",iClient,iAttacker,fDamage);

    return 
HAM_IGNORED;

If I hurt jumping, show the text.. But when monster attack me, no...
schirodes is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-27-2014 , 04:32   Re: TakeDamage from Monster
Reply With Quote #6

Ah well, it makes sense, Ham uses the virtual table in the mod ; but MonsterMod is a bit special, it basically uses HLSDK as base but modified a bit to be a metamod plugin. So, you will need to hook TakeDamage in MonsterMod. You can probably use Orpheu, filling "library" with "monstermod", maybe removing "mod" and using the right indexes. This should be the same as HL1 (mod "valve"). Though it might be tricky and you may need to recompile MonsterMod the same way as the game.
You can also hook the CBasePlayer::TakeDamage with a signature in case you fail to deal with the virtual function. This should work if you don't forget to specify "monstermod".
__________________
Arkshine is offline
schirodes
Junior Member
Join Date: Sep 2008
Old 10-27-2014 , 15:43   Re: TakeDamage from Monster
Reply With Quote #7

Yes, that seems the only solution..

Thanks Arkshine! I need to read more about orpheu and modules to do this! Thx for all
schirodes 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 17:29.


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