Raised This Month: $ Target: $400
 0% 

register_event damage/dead


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sutar
Senior Member
Join Date: Sep 2010
Old 08-01-2013 , 12:50   register_event damage/dead
Reply With Quote #1

Help with function register_event Damages and Dead

Damages: damag(attacker, victim, damage, wpnindex, hitplace, TA)
Dead: daed(killer, victim, wpnindex, hitplace, TK)

Do not use client_damage and client_death
Sutar is offline
DWIGHTpN
Senior Member
Join Date: Jan 2013
Location: Romania.
Old 08-01-2013 , 12:57   Re: register_event damage/dead
Reply With Quote #2

Dead event:
PHP Code:
register_event("DeathMsg","event_death","a");
---------------------------------------------

public 
eventt_death() {
    
//Get the killer
    
new killer read_data(1);
    
    
//Get the victim
    
new victim read_data(2);

    
// You code

Damage (takedamage):
PHP Code:
public plugin_init()
      
RegisterHam("Ham_TakeDamage""player""Player_Hurt")

public 
Player_Hurt(victiminflictorattackerFloat:dmgdmgbits) {
       
      
//Bla bla bla


Next search on forum, you fiind 1000+ examples
DWIGHTpN is offline
Sutar
Senior Member
Join Date: Sep 2010
Old 08-01-2013 , 13:18   Re: register_event damage/dead
Reply With Quote #3

DWIGHTpN, damage with only RegisterHam() ???
kill can be

Code:
RegisterHam(Ham_Killed,"player","fwd_player_killed",0)
???

I just want that damage and death were from a single event
for example only use RegisterHam()

Code:
public plugin_init() {
      RegisterHam("Ham_TakeDamage", "player", "Player_Hurt", 1)
      RegisterHam(Ham_Killed, "player", "fwd_player_killed", 1)
}
Quote:
Next search on forum, you fiind 1000+ examples
Thanks, I searched but could not find ((

It will be good? or no?

Last edited by Sutar; 08-01-2013 at 13:19.
Sutar is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 08-01-2013 , 13:18   Re: register_event damage/dead
Reply With Quote #4

Use CSX Include from cstrike, its more easy ;)

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


public plugin_init() register_plugin("CSX Events",AMXX_VERSION_STR,"SmileY");

public 
client_damage(iAttacker,iVictim,iDamage,iWeaponID,iPlace,iTA)
{
    if(
iAttacker != iVictimclient_print(iAttacker,print_center,"%d",iDamage);
}

public 
client_death(iKiller,iVictim,iWeaponID,iPlace,iTK)
{
    if((
iKiller != iVictim) && (iPlace == HIT_HEAD))
    {
        new 
szName[2][32];
        
get_user_name(iKiller,szName[0],charsmax(szName[]));
        
get_user_name(iVictim,szName[1],charsmax(szName[]));
        
        
client_print(0,print_center,"%s Killed %d with a Amazing HeadShot",szName[0],szName[1]);
    }

But if you use another mod than cstrike, use ham_* or ClientDamage event
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Sutar
Senior Member
Join Date: Sep 2010
Old 08-01-2013 , 13:29   Re: register_event damage/dead
Reply With Quote #5

I do not want to use #include <csx>
I will use one dll for the entire server?
I disabled csx and I will not use it
Sutar is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 08-01-2013 , 13:32   Re: register_event damage/dead
Reply With Quote #6

Quote:
Originally Posted by Sutar View Post
I do not want to use #include <csx>
I will use one dll for the entire server?
I disabled csx and I will not use it
What? You running a cstrike or its another mod?
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Sutar
Senior Member
Join Date: Sep 2010
Old 08-01-2013 , 13:34   Re: register_event damage/dead
Reply With Quote #7

Quote:
Originally Posted by ^SmileY View Post
What? You running a cstrike or its another mod?
cstrike
Sutar is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 08-01-2013 , 13:37   Re: register_event damage/dead
Reply With Quote #8

Quote:
Originally Posted by Sutar View Post
I will use one dll for the entire server?
Why? How?

P.S. That's dumb.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 08-01-2013 , 13:47   Re: register_event damage/dead
Reply With Quote #9

Quote:
Originally Posted by wickedd View Post
Why? How?

P.S. That's dumb.
Strange, he removed csx from default cstrike package and instaled with amxx core..
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Sutar
Senior Member
Join Date: Sep 2010
Old 08-01-2013 , 13:54   Re: register_event damage/dead
Reply With Quote #10

Quote:
Originally Posted by ^SmileY View Post
Strange, he removed csx from default cstrike package and instaled with amxx core..
No, they work good
Sutar 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 15:48.


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