Raised This Month: $ Target: $400
 0% 

Sending "player_death" event doesn't work


Post New Thread Reply   
 
Thread Tools Display Modes
NeoTrantor
Member
Join Date: Mar 2009
Location: Germany
Old 07-16-2010 , 04:24   Re: Sending "player_death" event doesn't work
Reply With Quote #11

Hi,

now where DukeHacks is outdated, any suggestions on how to do this?
__________________
NeoTrantor is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 07-16-2010 , 07:25   Re: Sending "player_death" event doesn't work
Reply With Quote #12

Quote:
Originally Posted by Greyscale View Post

And make sure to return with

Code:
return Plugin_Changed;
Whats Plugin_Changed do different from continue?
__________________
Peoples Army is offline
Kigen
BANNED
Join Date: Feb 2008
Old 07-16-2010 , 08:24   Re: Sending "player_death" event doesn't work
Reply With Quote #13

Create a point_hurt entity. Have fun that way.
Kigen is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 07-16-2010 , 10:54   Re: Sending "player_death" event doesn't work
Reply With Quote #14

Like Kigen says, you can just damage the player yourself.
Here's a fun little snippet I once found:

I believe it was pimpinjuice that I got this from.

PHP Code:
//Damage types you can have
#define DMG_GENERIC            0
#define DMG_CRUSH            (1 << 0)
#define DMG_BULLET            (1 << 1)
#define DMG_SLASH            (1 << 2)
#define DMG_BURN            (1 << 3)
#define DMG_VEHICLE            (1 << 4)
#define DMG_FALL            (1 << 5)
#define DMG_BLAST            (1 << 6)
#define DMG_CLUB            (1 << 7)
#define DMG_SHOCK            (1 << 8)
#define DMG_SONIC            (1 << 9)
#define DMG_ENERGYBEAM            (1 << 10)
#define DMG_PREVENT_PHYSICS_FORCE    (1 << 11)
#define DMG_NEVERGIB            (1 << 12)
#define DMG_ALWAYSGIB            (1 << 13)
#define DMG_DROWN            (1 << 14)
#define DMG_TIMEBASED            (DMG_PARALYZE | DMG_NERVEGAS | DMG_POISON | DMG_RADIATION | DMG_DROWNRECOVER | DMG_ACID | DMG_SLOWBURN)
#define DMG_PARALYZE            (1 << 15)
#define DMG_NERVEGAS            (1 << 16)
#define DMG_POISON            (1 << 17)
#define DMG_RADIATION            (1 << 18)
#define DMG_DROWNRECOVER        (1 << 19)
#define DMG_ACID            (1 << 20)
#define DMG_SLOWBURN            (1 << 21)
#define DMG_REMOVENORAGDOLL        (1 << 22)
#define DMG_PHYSGUN            (1 << 23)
#define DMG_PLASMA            (1 << 24)
#define DMG_AIRBOAT            (1 << 25)
#define DMG_DISSOLVE            (1 << 26)
#define DMG_BLAST_SURFACE        (1 << 27)
#define DMG_DIRECT            (1 << 28)
#define DMG_BUCKSHOT            (1 << 29)

DealDamage(victim,damage,attacker=0,dmg_type=0,String:weapon[]="")
{
    if(
victim>&& IsValidEdict(victim) && IsClientInGame(victim) && IsPlayerAlive(victim) && damage>0)
    {
        new 
String:dmg_str[16];
        
IntToString(damage,dmg_str,16);
        new 
String:dmg_type_str[32];
        
IntToString(dmg_type,dmg_type_str,32);
        
PointHurt CreateEntityByName("point_hurt");
        if(
PointHurt)
        {
            
DispatchKeyValue(victim,"targetname","dmged_target");
            
DispatchKeyValue(PointHurt,"DamageTarget","dmged_target");
            
DispatchKeyValue(PointHurt,"Damage",dmg_str);
            
DispatchKeyValue(PointHurt,"DamageType",dmg_type_str);
            if(!
StrEqual(weapon,""))
            {
                
DispatchKeyValue(PointHurt,"classname",weapon);
            }
            
DispatchSpawn(PointHurt);
            
AcceptEntityInput(PointHurt,"Hurt",(attacker>0)?attacker:-1);
            
DispatchKeyValue(PointHurt,"classname","point_hurt");
            
DispatchKeyValue(victim,"targetname","nondmged_target");
            
RemoveEdict(PointHurt);
        }
    }

Use this to damage someone.
For example:
DealDamage(client,100,client,DMG_GENERIC,"wea pon_knife"); (For some odd reason, a space keeps kreeping in weapon here. Very odd.)
This would make the client kill itself using a generic damage of 100, with weapon_knife.

I use this quite a lot.
Add the velocity to the ragdoll before that.
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.

Last edited by Monkeys; 07-16-2010 at 10:57.
Monkeys is offline
NeoTrantor
Member
Join Date: Mar 2009
Location: Germany
Old 07-16-2010 , 11:01   Re: Sending "player_death" event doesn't work
Reply With Quote #15

I found that today too and I'll try to use it in my plugin. Thanks for the hint anyway!
__________________
NeoTrantor is offline
dirka_dirka
Veteran Member
Join Date: Nov 2009
Old 07-16-2010 , 12:34   Re: Sending "player_death" event doesn't work
Reply With Quote #16

Quote:
Originally Posted by Monkeys View Post
DealDamage(client,100,client,DMG_GENERIC,"wea pon_knife"); (For some odd reason, a space keeps kreeping in weapon here. Very odd.)
add a flippin space then.. 45 chars w/o space = space where you dont want it:
DealDamage(client ,100, client, DMG_GENERIC, "weapon_knife");
dirka_dirka is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-16-2010 , 14:37   Re: Sending "player_death" event doesn't work
Reply With Quote #17

Quote:
Originally Posted by Peoples Army View Post
Whats Plugin_Changed do different from continue?
Tells the hook that a variable was changed. But looking back you are changing event variables, not function variables. So Plugin_Continue should have been fine.
__________________
Greyscale is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 07-16-2010 , 15:34   Re: Sending "player_death" event doesn't work
Reply With Quote #18

Quote:
Originally Posted by dirka_dirka View Post
add a flippin space then.. 45 chars w/o space = space where you dont want it:
DealDamage(client ,100, client, DMG_GENERIC, "weapon_knife");
Had no idea. Strange filter.
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys 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 01:15.


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