Raised This Month: $ Target: $400
 0% 

Detect DMG_FALL Death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
YakumoHiratsuhi
Veteran Member
Join Date: Dec 2010
Location: Dreαmlαnd.
Old 05-06-2013 , 15:17   Re: Detect DMG_FALL Death
Reply With Quote #1

I'm pretty sure there's a better way out there, but here's mine.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#define DMG_FALL        (1<<5)      // Fell too far (taken from hldsk_const)
#define PLUGIN    "Falling Death.."
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_TakeDamage"player""fw_Player_TakeDamage")
}

// Player took damage
public fw_Player_TakeDamage(victiminflictorattackerFloat:damagedmgtype)
{
    if(!(
dmgtype DMG_FALL))
        return 
HAM_IGNORED;
    
    new 
Float:health Float:get_user_health(victim)
    if(
health damage <= 0)
        
dmg_fall_killed_player(victimdamage)
    
    return 
HAM_HANDLED;
}

// Player got killed by DMG_FALL type.
public dmg_fall_killed_player(victimFloat:damage)
{
    
// Do what you want here..
    

__________________
"Podra parecer ridiculo o imposible, pero este es el camino que seguimos los verdaderos hombres, si hay un muro en el camino, lo derribamos, si no hay camino, haremos uno, con nuestras propias manos, porque el magma de nuestro corazón arde en llamas."

Last edited by YakumoHiratsuhi; 05-06-2013 at 15:22.
YakumoHiratsuhi is offline
Send a message via MSN to YakumoHiratsuhi
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 10:56.


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