С други думи да се премахне lang-a и да се напише това съобщение: Infection on: %s
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <zombieplague>
new const ZP_CSO_PLUGIN_NAME[] = "[ZP] CSO Countdown"
new const ZP_CSO_PLUGIN_VERSION[] = "5.0"
new const ZP_CSO_PLUGIN_AUTHOR[] = "jc980"
new zp_cso_sec, zp_center_textmsg
new const zp_cso_roundstart[][] =
{
"sound/zombie_plague/cso/zombi_start.mp3"
}
new zp_cso_countchant[10][] =
{
"zombie_plague/cso/1.wav",
"zombie_plague/cso/2.wav",
"zombie_plague/cso/3.wav",
"zombie_plague/cso/4.wav",
"zombie_plague/cso/5.wav",
"zombie_plague/cso/6.wav",
"zombie_plague/cso/7.wav",
"zombie_plague/cso/8.wav",
"zombie_plague/cso/9.wav",
"zombie_plague/cso/10.wav"
}
public plugin_init()
{
register_plugin(ZP_CSO_PLUGIN_NAME, ZP_CSO_PLUGIN_VERSION, ZP_CSO_PLUGIN_AUTHOR)
register_event("HLTV", "zp_cso_round_start", "a", "1=0", "2=0")
zp_center_textmsg = get_user_msgid("TextMsg")
}
public plugin_precache()
{
register_dictionary("zp_cso_countdown.txt")
new i
for(i = 0; i < sizeof zp_cso_roundstart; i++)
engfunc(EngFunc_PrecacheGeneric, zp_cso_roundstart[i])
for(i = 0; i < sizeof zp_cso_countchant; i++)
engfunc(EngFunc_PrecacheSound, zp_cso_countchant[i])
}
public zp_cso_round_start()
{
new iMP3, MP3[64]
iMP3 = random_num(0,charsmax(zp_cso_roundstart))
copy(MP3, charsmax(MP3), zp_cso_roundstart[iMP3])
client_cmd(0,"mp3 play ^"%s^"", MP3)
zp_cso_sec = 15
zp_cso_countdown()
}
public zp_cso_countdown()
{
new iText[64]
format(iText, charsmax(iText), "%L", LANG_PLAYER, "ZP_CSO_COUNTDOWN_NOTICE", zp_cso_sec)
zp_clientcenter_text(0, iText)
zp_cso_sec -= 1
if(zp_cso_sec < 10)
{
zp_cso_chantdown()
}
if(zp_cso_sec >= 1)
{
set_task(1.0, "zp_cso_countdown")
}
}
public zp_cso_chantdown()
{
new iChant[64], iSound
iSound = zp_cso_sec
if(iSound == -1)
return PLUGIN_CONTINUE
copy(iChant, charsmax(iChant), zp_cso_countchant[iSound])
client_cmd(0,"speak ^"%s^"", iChant)
return PLUGIN_CONTINUE
}
stock zp_clientcenter_text(id, zp_message[])
{
new dest
if (id) dest = MSG_ONE
else dest = MSG_ALL
message_begin(dest, zp_center_textmsg, {0,0,0}, id)
write_byte(4)
write_string(zp_message)
message_end()
}