PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new const your_weird_codes[][] =
{
"1alkv$5&8#",
"io54!@)h(",
"=025&cnow"
}
new g_roundnum, g_codenum
new bool:g_timeexpired
new cvar_time, cvar_chance
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("round_start", 2, "0=World triggered", "1=Round_Start")
register_clcmd("say", "sayasdf")
register_clcmd("say_team", "sayasdf")
cvar_time = register_cvar("time_4_code", "10")
cvar_chance = register_cvar("chance_code", "50")
time_expired()
}
public time_expired()
{
g_timeexpired = true
}
public round_start()
{
g_codenum = -1
if((g_roundnum-1) % 3 == 0)
{
g_codenum = random(charsmax(your_weird_codes))
g_timeexpired = false
set_task(get_pcvar_float(cvar_time), "time_expired")
set_hudmessage(255, 0, 0, -1.0, 0.01)
show_hudmessage(0, "The weird code of the round is: %s^nYou have %d seconds to type it", your_weird_codes[g_codenum], get_pcvar_num(cvar_time))
}
g_roundnum++
}
public sayasdf(id)
{
if(g_codenum < 0)
return PLUGIN_CONTINUE
new said[32]
read_args(said, 31)
remove_quotes(said)
if(equal(said, your_weird_codes[g_codenum]))
{
if(g_timeexpired)
{
client_print(id, print_center, "Sorry, time for typing the code is left")
}
else
{
if(random_num(0, 100) > get_pcvar_num(cvar_chance))
{
client_print(id, print_center, "Sorry, try again")
}
else
{
client_print(id, print_center, "Yay, you won a pink pony")
}
}
}
return PLUGIN_CONTINUE
}
__________________