Im make const zadminflags = ADMIN_BAN , class is not for admins ... all users get this clasas. This is for BaseBuilder 6.5 Tirant.
Code:
#include < amxmodx >
#include < fakemeta >
#include < zombieplague >
#include < engine >
new const zname[ ] = "Paralize Zombie"
new const zinfo[ ] = "\y[\rDisarm hit's\y]"
new const zmodel[ ] = "bb_zmparalize"
new const zclawmodel[ ] = "v_zmparalize"
const zhealth = 2500
const zspeed = 280
const Float:zgravity = 0.9
const Float:zknockback = 1.0
const zadminflags = ADMIN_BAN
new zClassId, SurvivorDisarm, DisarmTime, DisarmChance, ScreenFadeEffects, SpR_Paralyzed
new bool: CantFire[ 33 ] = false;
public plugin_init()
{
register_plugin("BB CLASS : Paralizer Zombie", "1.1", "THE_WINNER")
register_event("Damage", "Event_Damage", "b", "2!0", "3=0", "4!0")
DisarmChance = register_cvar("Chance to disarm (%)", "8" )
DisarmTime = register_cvar("Disarm Time", "2.0" ) // How much time the Human will stay disarm
zClassId = zp_register_zombie_class(zname, zinfo, zmodel, zclawmodel, zhealth, zspeed, zgravity, zknockback, zadminflags)
ScreenFadeEffects = get_user_msgid( "ScreenFade" )
}
public plugin_precache( )
SpR_Paralyzed = precache_model( "sprites/paralyzed.spr" )
public Event_Damage( victim )
{
new id
id = get_user_attacker( victim )
if( zp_get_user_zombie_class( victim ) != zClassId
|| !zp_get_user_zombie( victim ) )
return PLUGIN_CONTINUE;
new Rand = random_num( 1, 100 )
if( Rand > 0 && Rand <= get_pcvar_num( DisarmChance ) )
{
CantFire[ id ] = true
Effects( id )
set_task( get_pcvar_float( DisarmTime ), "StopDisarmCc", id )
}
return PLUGIN_CONTINUE;
}
public client_PreThink( Player )
{
if( !CantFire[ Player ] )
return PLUGIN_CONTINUE;
entity_set_int( Player, EV_INT_button, entity_get_int( Player, EV_INT_button ) & ~IN_ATTACK ) // Player will scared :D
return PLUGIN_CONTINUE;
}
public Effects( id )
{
message_begin( MSG_ONE_UNRELIABLE, ScreenFadeEffects,.player = id )
write_short( ( 1<<10 ) )
write_short( 0 )
write_short( 0x0000 )
write_byte( 255 ) // Red color
write_byte( 0 ) // G
write_byte( 0 ) // B
write_byte( 255 )
message_end( )
new Float: HumanOrigin[ 3 ]
entity_get_vector( id, EV_VEC_origin, HumanOrigin )
engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, HumanOrigin, 0)
write_byte( TE_SPRITETRAIL )
engfunc( EngFunc_WriteCoord, HumanOrigin[ 0 ] )
engfunc( EngFunc_WriteCoord, HumanOrigin[ 1 ] )
engfunc( EngFunc_WriteCoord, HumanOrigin[ 2 ] )
engfunc( EngFunc_WriteCoord, HumanOrigin[ 0 ] )
engfunc( EngFunc_WriteCoord, HumanOrigin[ 1 ] )
engfunc( EngFunc_WriteCoord, HumanOrigin[ 2 ] + 30 )
write_short( SpR_Paralyzed )
write_byte( 3 )
write_byte( 30 )
write_byte( 10 )
write_byte( 45 )
write_byte( 40 )
message_end( )
}
public StopDisarmCc( id )
{
CantFire[ id ] = false
}