Half-Life Icon HL Script

[AMXX] [ALL] No Fall Death

SEX! Ok, we got your attention. We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending Rj. points.
  • Post: Give Rj. your thoughts on this Script.
  • Vote: Help Rj. win the Monthly Awards.
  • Rate: Give this Script a rating out of 10.
  • Flag: Alert moderators and warn members of a problem with this Script.
  • Watch: Get notified when this Script is updated.
Mascot

Join the community!

Join GameBanana

Already a Bananite? Login

110 lines | 2 kb | Raw Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

// ------------------------------------
new const PLUGIN[] =  "No Fall Death"
#define VERSION          "1.0"
// ------------------------------------

#define RANDOM_MIN_VALUE        1.0
#define REGENERATE_MIN_VALUE    1.0

new Float: Health[ 33 ];

new toggle_plugin, toggle_interval, toggle_amount;
new p_plugin, p_int, p_amount;
new g_msghealth;

public plugin_init()
{
        register_plugin( PLUGIN, VERSION, "anakin_cstrike" );
       
        register_logevent( "roundstart", 2, "1=Round_Start" );
        RegisterHam( Ham_TakeDamage, "player", "ham_damage" );
       
        toggle_plugin = register_cvar( "nfd_plugin", "1" );
        toggle_interval = register_cvar( "nfd_interval", "5" );
        toggle_amount = register_cvar( "ndf_amount", "3" );
       
        g_msghealth = get_user_msgid( "Health" );
}
public roundstart()
{
        p_plugin = get_pcvar_num( toggle_plugin );
        p_int = get_pcvar_num( toggle_interval );
        p_amount = get_pcvar_num( toggle_amount );
}

public ham_damage( this, inflictor, attacker, Float:damage, damagebits )
{
        if( !p_plugin )
                return FMRES_IGNORED;
        if( !( damagebits & DMG_FALL ) )
                return HAM_IGNORED;
       
        if( task_exists( this+123 ) )
                remove_task( this+123 );       
       
        pev( this, pev_health, Health[ this ] );       
       
        switch( p_plugin )
        {
                case 1: return HAM_SUPERCEDE;
                case 2:
                {
                        if( Check( damage, Health[ this ] ) )
                        {
                                SetHealth( this, random_float( RANDOM_MIN_VALUE, Health[ this ] ) );
                                return HAM_SUPERCEDE;
                        }
                }
                case 3:
                {
                        if( Check( damage, Health[ this ] ) )
                        {
                                if( task_exists( this+123 ) )
                                        remove_task( this+123 );
               
                                SetHealth( this, REGENERATE_MIN_VALUE );
                                set_task( float( p_int ), "give", this+123, _, _, "b" );
               
                                return HAM_SUPERCEDE;
                        }
                }
        }
       
        return HAM_IGNORED;
}

public give( index )
{
        index -= 123;
       
        new Float: hp;
        pev( index, pev_health, hp );
       
        new Float: total = hp + float( p_amount );
        SetHealth( index, total );
               
        if( hp >= Health[ index ] )
        {
                SetHealth( index, Health[ index ] );
                remove_task( index );
                return 0;
        }
       
        return 0;
}

SetHealth( index, Float: hp )
{
        message_begin( MSG_ONE, g_msghealth, {0,0,0}, index );
        write_byte( floatround( hp ) );
        message_end();
       
        set_pev( index, pev_health, hp );
}

bool: Check( Float:value, Float:compare )
        return ( value >= compare ) ? true : false;
Description: With this plugin on you server, you can block the damage done at falling from a high place. There are 3 options:
  • no damage at all
  • random health between a min value and player's hp
  • random health value and regenerate hp
Modules: Fakemeta & Hamsandwich

Cvars: 
nfd_plugin
  • 0 - disabled
  • 1 - no damage
  • 2 - random health
  • 3 - random health & regenerate
(default 1)

nfd_interval - interval in seconds for regenerating hp (default 5)
ndf_amount - amount of health gived at every interval (default 3)

Comments

None found

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Credits

Original Authors
anakin_cstrike
Developed, AMXX codes/script and Improvements

Submitter

Rj. avatar
Rj. IN PLAYGROUND
Homepage
Member Joined 9 months ago
34 medals 4 legendary 8 rare
  • Submitted 15 Tools Medal icon
  • Submitted 50 Gamefiles Medal icon
  • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
  • Thanked 500 submitters Medal icon
  • 2nd Place - Game Poetry Contest Medal icon
  • Submitted 5 Tools Medal icon

Rj.
Redistributor
Are you the owner? Request Ownership
Send a Private Message to the submitter

Category

Stats

Posts
0
Views
129
Date Added
1 month ago
Feb 24 2017 @ 12:56pm UTC
Date Updated
1 month ago
Feb 24 2017 @ 12:56pm UTC