AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQ] Fall down damage (https://forums.alliedmods.net/showthread.php?t=174312)

Lolz0r 12-18-2011 15:50

[REQ] Fall down damage
 
I need a plugin that when you fall doens't take you health but shows how it should.

ConnorMcLeod 12-18-2011 16:50

Re: [REQ] Fall down damage + immune
 
PHP Code:

#include <amxmodx>
#include <hamsandwich>

#define VERSION "0.0.1"
#define PLUGIN "No Fall Damage"

const DMG_FALL = (1<<5)      // Fell too far

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
RegisterHam(Ham_TakeDamage"player""CBasePlayer_TakeDamage"false)
}

public 
CBasePlayer_TakeDamage(idiInflictoriAttackerFloat:flDamagebitsDamageType)
{
    if( 
bitsDamageType == DMG_FALL )
    {
        
set_hudmessage(0100200, -1.0, -1.00_3.00.0010.001, -1)
        
show_hudmessage(id"You should have take %.0f damage"flDamage)
        
SetHamReturnInteger(0)
        return 
HAM_SUPERCEDE
    
}
    return 
HAM_IGNORED



Lolz0r 12-18-2011 17:10

Re: [REQ] Fall down damage + immune
 
It's work, thanks!

EDIT: And only a block that? :

PHP Code:

#include <amxmodx>
#include <hamsandwich>

#define VERSION "0.0.1"
#define PLUGIN "No Fall Damage"

const DMG_FALL = (1<<5)      // Fell too far

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
RegisterHam(Ham_TakeDamage"player""CBasePlayer_TakeDamage"false)
}

public 
CBasePlayer_TakeDamage(idiInflictoriAttackerFloat:flDamagebitsDamageType)
{
    if( 
bitsDamageType == DMG_FALL )
    {
        
SetHamReturnInteger(0)
        return 
HAM_SUPERCEDE
    
}
    return 
HAM_IGNORED



ConnorMcLeod 12-18-2011 18:06

Re: [REQ] Fall down damage + immune
 
yep

Lolz0r 12-19-2011 08:14

Re: [REQ] Fall down damage + immune
 
Okey, thanks again. :twisted:


All times are GMT -4. The time now is 20:55.

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