Quote:
Originally Posted by Arkshine
Depending what you do with it.
|
Something like this ?
PHP Code:
#include <amxmodx>
#include <zombieplague>
new g_zclass_asdzombie, duration, bind
new cooldown_time[ 33 ]
new Float:cooldown= 30.0
new const zclass_name[] = { "asd Zombie" }
new const zclass_info[] = { "asd" }
new const zclass_model[] = { "zombie_source" }
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass_health = 1700
const zclass_speed = 250
const Float:zclass_gravity = 1.0
const Float:zclass_knockback = 0.0
public plugin_init( )
{
register_clcmd( "+asd", "asd_start", ADMIN_ALL, "bind [key] +asd" )
bind = register_cvar( "asd_bindkey", "1" )
duration = register_cvar( "asd_duration", "10.0" )
}
public plugin_precache( )
{
g_zclass_asdzombie = zp_register_zombie_class( zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback )
}
public zp_user_infected_post( id, infector )
{
if ( zp_get_user_zombie_class( id ) == g_zclass_asdzombie )
{
cooldown_time[ id ] = floatround( cooldown )
remove_task( id )
new mode = get_pcvar_num( bind )
if ( mode == 1 )
{
client_cmd( id, "bind v ^"+asd^"" )
// chat_print( id, "Press ^'^'V^'^' to use asd." )
}
if ( mode == 0 )
{
// chat_print( id, "Type bind <key> +asd to use asd." )
}
}
}
public asd_start( id )
{
if ( !is_user_alive( id ) )
{
chat_print( id, "You can't asd when you are dead." )
return
}
else
{
asd( id )
cooldown_time[ id ] = floatround( cooldown )
set_task( 1.0, "ShowHUD", id, _, _, "a", cooldown_time[ id ] )
}
}
public asd( id )
{
set_task( get_pcvar_float( duration ), "asd_duration", id )
}
public asd_duration( id )
{
// chat_print( id, "asd has worn off." )
}
public ShowHUD( id )
{
cooldown_time[ id ] = cooldown_time[ id ] - 1;
set_hudmessage( random_num( 0,255 ), random_num( 0,255 ), random_num( 0,255 ), 0.75, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1 )
show_hudmessage( id, "asd cooldown: %d", cooldown_time[ id ] )
}
__________________