Raised This Month: $ Target: $400
 0% 

HAM_TAKEDAMAGE problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 03-18-2010 , 11:31   HAM_TAKEDAMAGE problem
Reply With Quote #1

Well i started learning hamsandwich module, and i got idea for one plugin.
So now i try to make a test function to print the victim into the chat

PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage");
}

public 
fw_TakeDamage(inflictorvictim) {
    new 
v_name[32];
    
get_user_name(victimv_namesizeof(v_name) - 1);
    
    
client_print(inflictorprint_chat"You've just hit %s! Nice work."v_name);

So i don't know about this, but it only prints out the message when i hit myself o_0.
So can you help me?
Lure.d is offline
Send a message via Skype™ to Lure.d
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 03-18-2010 , 11:37   Re: HAM_TAKEDAMAGE problem
Reply With Quote #2

public fwdTakeDamage(iVictim, iWeapon, iAttacker, Float:flDamage, iDmgBits)
__________________
minimiller is offline
Send a message via MSN to minimiller
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 03-18-2010 , 11:42   Re: HAM_TAKEDAMAGE problem
Reply With Quote #3

still same.
Lure.d is offline
Send a message via Skype™ to Lure.d
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-18-2010 , 11:46   Re: HAM_TAKEDAMAGE problem
Reply With Quote #4

Quote:
Originally Posted by minimiller View Post
public fwdTakeDamage(iVictim, iWeapon, iAttacker, Float:flDamage, iDmgBits)
This is wrong, second param is not the weapon, it's in most cases the same as attacker. It can be the nade id when it is a HE.

PHP Code:
#include <amxmodx>
#include <hamsandwich>

new const VERSION[] = "0.0.1"

public plugin_init()
{
    
register_plugin("Regeneration"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_TakeDamage"player""CBasePlayer_TakeDamage")
}

public 
CBasePlayer_TakeDamage(id eInflictoreAttackerFloat:flDamagebitsDamageType )
{
    
// First check if attacker is a player
    
if( eAttacker != id && is_user_connectedeAttacker ) )
    {
        new 
szName[32]
        
get_user_name(idszNamecharsmax(szName))
        
client_print(eAttackerprint_chat"You've just hit %s! Nice work."szName)
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 03-18-2010 , 11:56   Re: HAM_TAKEDAMAGE problem
Reply With Quote #5

good for self detection but not good for output, still no message if i hit a player

EDIT: NVM using csx for the damage...

Last edited by Lure.d; 03-18-2010 at 12:19.
Lure.d is offline
Send a message via Skype™ to Lure.d
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-18-2010 , 13:28   Re: HAM_TAKEDAMAGE problem
Reply With Quote #6

You use cs1.6 steam ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 03-18-2010 , 13:38   Re: HAM_TAKEDAMAGE problem
Reply With Quote #7

well yes... i can screenshot and you can always go to my steam page ^_^ ...

What a DUMB question though, non steam isn't alloved here.
Lure.d is offline
Send a message via Skype™ to Lure.d
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-18-2010 , 13:43   Re: HAM_TAKEDAMAGE problem
Reply With Quote #8

Quote:
Originally Posted by Lure.d View Post
What a DUMB question though, non steam isn't alloved here.
No it's not. Non-Steam isn't allowed here but it's still attempted to be used here.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-18-2010 , 14:22   Re: HAM_TAKEDAMAGE problem
Reply With Quote #9

I guess then you miss the file hamdata.ini in configs folder, or that file is wrong.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 03-18-2010 , 15:08   Re: HAM_TAKEDAMAGE problem
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
I guess then you miss the file hamdata.ini in configs folder, or that file is wrong.
You were right, my fault
Lure.d is offline
Send a message via Skype™ to Lure.d
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 08:47.


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