|
发表于 2009-6-4 20:41:05
|
显示全部楼层
来自 中国–广东–广州–天河区
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#define PLUGIN "倒数10秒插件"
#define VERSION "1.0"
#define AUTHOR "Martin"
new countdown
new time_s
public plugin_init () {
register_plugin ( PLUGIN , VERSION , AUTHOR )
register_event ( "HLTV" , "event_round_start" , "a" , "1=0" , "2=0" )
}
public plugin_precache ()
{
precache_sound ( "vox/ten.wav" )
precache_sound ( "vox/nine.wav" )
precache_sound ( "vox/eight.wav" )
precache_sound ( "vox/seven.wav" )
precache_sound ( "vox/six.wav" )
precache_sound ( "vox/five.wav" )
precache_sound ( "vox/four.wav" )
precache_sound ( "vox/three.wav" )
precache_sound ( "vox/two.wav" )
precache_sound ( "vox/one.wav" )
}
public event_round_start ()
{
set_task ( 4.0 , "zombie_countdown" )
time_s = 10
countdown = 9
}
public zombie_countdown ()
{
new speak [ 10 ][] = { "vox/one.wav" , "vox/two.wav" , "vox/three.wav" , "vox/four.wav" , "vox/five.wav" , "vox/six.wav" , "vox/seven.wav" , "vox/eight.wav" , "vox/nine.wav" , "vox/ten.wav" }
emit_sound ( 0 , CHAN_VOICE , speak [ countdown ], 1.0 , ATTN_NORM , 0 , PITCH_NORM )
countdown --
if(time_s = 10) set_hudmessage(0, 255, 0, -1.0, 0.72, 0, 1.0, 6.0, 0.6, 0.6, 6)
else if(time_s = 9 ) set_hudmessage(255, 250, 0, -1.0, 0.72, 0, 1.0, 6.0, 0.6, 0.6, 6)
else if(time_s = 8 ) set_hudmessage(255, 250, 0, -1.0, 0.72, 0, 1.0, 6.0, 0.6, 0.6, 6)
else if(time_s = 7 ) set_hudmessage(255, 250, 0, -1.0, 0.72, 0, 1.0, 6.0, 0.6, 0.6, 6)
else if(time_s = 6 ) set_hudmessage(255, 250, 0, -1.0, 0.72, 0, 1.0, 6.0, 0.6, 0.6, 6)
else if(time_s = 5 ) set_hudmessage(255, 250, 0, -1.0, 0.72, 0, 1.0, 6.0, 0.6, 0.6, 6)
else if(time_s = 4 ) set_hudmessage(255, 250, 0, -1.0, 0.72, 0, 1.0, 6.0, 0.6, 0.6, 6)
else if(time_s = 3 ) set_hudmessage(255, 250, 0, -1.0, 0.72, 0, 1.0, 6.0, 0.6, 0.6, 6)
else if(time_s = 2 ) set_hudmessage(255, 250, 0, -1.0, 0.72, 0, 1.0, 6.0, 0.6, 0.6, 6)
else if(time_s = 1 ) set_hudmessage(255, 250, 0, -1.0, 0.72, 0, 1.0, 6.0, 0.6, 0.6, 6)
else set_hudmessage(255, 0, 0, -1.0, 0.72, 1, 1.0, 0.8, 0.6, 0.6, 6)
show_hudmessage(0,"T型病毒在正在寻找宿主,%i秒后出现僵尸",time_s)
//client_print( 0 , print_center, "T型病毒在正在寻找宿主,%i秒后出现僵尸.", time_s);
-- time_s ;
if( time_s >= 1 )
{
set_task ( 1.0 , "zombie_countdown" )
}
} |
|