AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   register_event damage/dead (https://forums.alliedmods.net/showthread.php?t=222347)

Sutar 08-01-2013 12:50

register_event damage/dead
 
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

DWIGHTpN 08-01-2013 12:57

Re: register_event damage/dead
 
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 :)

Sutar 08-01-2013 13:18

Re: register_event damage/dead
 
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?

^SmileY 08-01-2013 13:18

Re: register_event damage/dead
 
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 :(

Sutar 08-01-2013 13:29

Re: register_event damage/dead
 
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

^SmileY 08-01-2013 13:32

Re: register_event damage/dead
 
Quote:

Originally Posted by Sutar (Post 2003648)
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?

Sutar 08-01-2013 13:34

Re: register_event damage/dead
 
Quote:

Originally Posted by ^SmileY (Post 2003650)
What? You running a cstrike or its another mod?

cstrike

wickedd 08-01-2013 13:37

Re: register_event damage/dead
 
Quote:

Originally Posted by Sutar (Post 2003648)
I will use one dll for the entire server?

Why? How?

P.S. That's dumb.

^SmileY 08-01-2013 13:47

Re: register_event damage/dead
 
Quote:

Originally Posted by wickedd (Post 2003653)
Why? How?

P.S. That's dumb.

Strange, he removed csx from default cstrike package and instaled with amxx core..

Sutar 08-01-2013 13:54

Re: register_event damage/dead
 
Quote:

Originally Posted by ^SmileY (Post 2003658)
Strange, he removed csx from default cstrike package and instaled with amxx core..

No, they work good


All times are GMT -4. The time now is 15:48.

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