|
它有时会显示在两个地方(即这里一个,那里一个),不知道错在哪里.............
//**************************
#include <amxmod>
#include <amxmisc>
new g_c4timer;
new mp_timec4;
new bool:b_planted = false;
new const PLUGIN[] = "C4"
new const VERSION[] = "0.1"
new const AUTHOR[] = "A.MI"
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR);
mp_timec4 = get_cvar_num("mp_c4timer");
register_event("RoundTime", "newRound", "bc");
register_event("SendAudio", "endRound", "a", "2&%!MRAD_terwin", "2&%!MRAD_ctwin", "2&%!MRAD_rounddraw");
}
public newRound()
{
g_c4timer = 0
b_planted = false;
}
public endRound()
{
g_c4timer = -2
}
public bomb_planted()
{
mp_timec4 = get_cvar_num("mp_c4timer")
{
client_cmd(0, "spk misc/C4start")
}
b_planted = true;
g_c4timer = mp_timec4
set_task(1.0, "dispTime", 652450, "", 0, "b")
}
public bomb_defused()
{
mp_timec4 = get_cvar_num("mp_c4timer")
if(b_planted)
remove_task(652450);
}
public bomb_explode()
{
mp_timec4 = get_cvar_num("mp_c4timer")
if(b_planted)
remove_task(652450)
}
public dispTime()
{
mp_timec4 = get_cvar_num("mp_c4timer")
if(!b_planted)
remove_task(652450)
if(g_c4timer > 11) set_hudmessage(0, 255, 255, 0.3,0.5)
if(g_c4timer <= 10) set_hudmessage(255, 0, 0, 0.3,0.5)
show_hudmessage(0, "C 4 : %d",g_c4timer)
g_c4timer--
}
public plugin_precache()
{
precache_sound( "misc/C4start.wav")
return PLUGIN_CONTINUE
} |
|