hey all actually i need help with zp cso countdown plugin. it works good but i want the text for 20 seconds currently it only starts with 10 but i want to the text from 20 seconds for example
Remaining Seconds For Zombie Infection 20.
Remaining Seconds For Zombie Infection 19
Remaining Seconds For Zombie Infection 18
Remaining Seconds For Zombie Infection 17
Remaining Seconds For Zombie Infection 16
Remaining Seconds For Zombie Infection 15
... till 0
Here Is The Code
Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <zombieplague>
#define PLUGIN "[ ZE ] Countdown"
#define VERSION "1.0"
#define AUTHOR "littleboy"
new zp_cso_sec, zp_cso_sec_text , zp_center_textmsg
new const zp_cso_roundstart[][] =
{
"sound/city/other/start2.mp3",
"sound/zombie_escape/ZE_Ready.mp3"
}
new zp_cso_countchant[10][] =
{
"city/other/1.wav",
"city/other/2.wav",
"city/other/3.wav",
"city/other/4.wav",
"city/other/5.wav",
"city/other/6.wav",
"city/other/7.wav",
"city/other/8.wav",
"city/other/9.wav",
"city/other/10.wav"
}
public plugin_init()
{
register_plugin(PLUGIN , VERSION, AUTHOR)
register_event("HLTV", "zp_cso_round_start", "a", "1=0", "2=0")
zp_center_textmsg = get_user_msgid("TextMsg")
}
public plugin_precache()
{
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])
register_dictionary("zp_cso_countdown.txt")
}
public zp_cso_round_start()
{
set_task(2.0, "sound");
zp_cso_sec = 20
zp_cso_sec_text = 20
zp_cso_countdown()
}
public zp_round_started(mode, id)
{
zp_cso_sec = 0
zp_cso_sec_text = -1
}
public sound()
{
new iMP3, MP3[64]
iMP3 = random_num(0,1)
copy(MP3, charsmax(MP3), zp_cso_roundstart[iMP3])
client_cmd(0,"mp3 play ^"%s^"", MP3)
}
public zp_cso_countdown()
{
zp_cso_sec -= 1
if(zp_cso_sec < 10)
{
zp_cso_chantdown()
}
if(zp_cso_sec >= 1)
{
set_task(1.0, "zp_cso_countdown")
set_task(10.0, "text")
}
}
public text()
{
new texts
texts = zp_cso_sec_text
if(texts == -1)
return PLUGIN_CONTINUE
new iText[64]
format(iText, charsmax(iText), "%L", LANG_PLAYER, "ZP_CSO_COUNTDOWN_NOTICE", zp_cso_sec_text)
zp_clientcenter_text(0, iText)
zp_cso_sec_text -=1
return PLUGIN_CONTINUE
}
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()
}
Thanks In Advance