GameBanana shows no ads to members. Sign up now!
Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

[ZP] Addon: Critical Hit v1.2

A Config Script for Counter-Strike 1.6

84 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
/*                    [ZP] Addon: Critical Hit
                                by !Morte
       
        #Description :
                        Make a random critical hit when you are shooting an a enemy
       
        #Cvars :
                        zp_criticalhit_damage "3.0" // Damage Multiplier
                       
        #Credits :
                        meTaLiCroSS: From his "custom form" :P

        #Changelog :
                        v1.0: Plugin Release
                        v1.1: Added some sounds and effects
                        v1.2: Code fix, delete some redundant things and change some other things
*/


#include < amxmodx >
#include < hamsandwich >
#include < cs_ham_bots_api >
#include < fakemeta >
#include < fun >
#include < zombieplague >

new const sound_critical[] = "critical_hit/critical_hit.wav"

new cvar_criticaldamage
new gSyncHud

public plugin_precache( ) engfunc( EngFunc_PrecacheSound, sound_critical )

public plugin_init( )
{
        register_plugin( "Critical Hits", "1.2", "!Morte" )
       
        cvar_criticaldamage = register_cvar( "zp_criticalhit_damage", "4.0" )
       
        RegisterHam( Ham_TakeDamage, "player", "fw_TakeDamage" )
        RegisterHamBots(Ham_TakeDamage, "fw_TakeDamage")
       
        gSyncHud = CreateHudSyncObj( );
}

public fw_TakeDamage( victim, inflictor, attacker, Float:damage, damage_type )

{      

        if( is_user_alive(attacker) && !zp_get_user_zombie( attacker ) )

        {

                if( random_num( 0, 100 ) < random_num( 0, 100 ) < random_num( 0, 100 ) )

                {

                        SetHamParamFloat( 4, damage *= get_pcvar_float( cvar_criticaldamage ) )

                       

                        client_cmd( attacker, "spk ^"%s^"", sound_critical )

                       

                        set_hudmessage( 0, 255, 0, -1.0, -1.0, 0, 6.0, 1.1, 0.0, 0.0, 1 )

                        ShowSyncHudMsg( attacker, gSyncHud, "%d^nCritical Hit!", floatround( damage ) )

                }

               

                SetHamParamFloat( 4, damage )

        }

       

        return HAM_IGNORED;

}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/

Updates

1.2.1 1mo
  • Improvement Just add check whether the attacker is alive or not
Make a random critical hit when you are shooting an a enemy
Sign up to access this!

Embed

Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Key Authors
!Morte
scripter
Rainbowdash98
Rainbowdash98 Joined 4y ago
Offline
2,777 points Ranked 20,051st
10 medals 1 rare
  • Returned 1000 times Medal icon
  • One month a member Medal icon
  • Returned 100 times Medal icon
  • 6 months a member Medal icon
  • 1 year a member Medal icon
  • 2 years a member Medal icon
ZBOT support

Submitter

Rainbowdash98 avatar
Rainbowdash98 Joined 4y ago
Offline
2,777 points Ranked 20,051st
10 medals 1 rare
  • Returned 1000 times Medal icon
  • One month a member Medal icon
  • Returned 100 times Medal icon
  • 6 months a member Medal icon
  • 1 year a member Medal icon
  • 2 years a member Medal icon
Rainbowdash98
Redistributor
Are you the owner? Request Ownership
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

License

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • 2
  • 1.5k
  • 2
  • 4mo
  • 1mo
  • 1mo

More from Submitter

More AMX/X Scripts Scripts