View Single Post
New and Clueless
Senior Member
Join Date: Dec 2015
Old 01-06-2016 , 11:48   Re: [Help] small plugin fix [Easy]
Reply With Quote #7

Quote:
Originally Posted by Kakarot47 View Post
Try out this critical plugin i hope it will work

PHP Code:
/*                    [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 < fakemeta >
#include < fun >
#include < zombieplague >

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

new cvar_criticaldamage
new gSyncHud

public plugin_precache( ) engfuncEngFunc_PrecacheSoundsound_critical )

public 
plugin_init( )
{
    
register_plugin"Critical Hits""1.2""!Morte" )
    
    
cvar_criticaldamage register_cvar"zp_criticalhit_damage""3.0" )
    
    
RegisterHamHam_TakeDamage"player""fw_TakeDamage" )
    
    
gSyncHud CreateHudSyncObj( );
}

public 
fw_TakeDamagevictiminflictorattackerFloat:damagedamage_type )
{    
    if( !
zp_get_user_zombieattacker ) )
    {
        if (
random_num(01000) == 0)
        {
            
SetHamParamFloat4damage *= get_pcvar_floatcvar_criticaldamage ) )
            
            
client_cmdattacker"spk ^"%s^""sound_critical )
            
            
set_hudmessage02550, -1.0, -1.006.01.10.00.0)
            
ShowSyncHudMsgattackergSyncHud"%d^nCritical Hit!"floatrounddamage ) )
        }
        
        
SetHamParamFloat4damage )
    }
    
    return 
HAM_IGNORED;

alright, only thing i see you changed was extra bracket, thanks dude, im willing to learn if someone is willing to teach

edit: the plugin works perfectly, the chance is 1 in 1000 now isnt it? because it took me alot to get that extra random crit

Last edited by New and Clueless; 01-06-2016 at 11:49.
New and Clueless is offline