PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Simple Knife Warump"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"
#define TASKID 1234
new hudtimer, cvar, hudhandler, mp_freezetime, value
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_message(get_user_msgid("TextMsg") ,"message_TextMsg")
register_event("CurWeapon","switchweapon","be","1=1","2!29")
register_dictionary("simple_warmup.txt")
cvar = register_cvar("warmup_timer", "60")
hudhandler = CreateHudSyncObj()
}
public plugin_cfg()
{
mp_freezetime = get_cvar_pointer("mp_freezetime")
set_task(10.0, "read_vars")
}
public read_vars()
{
value = get_pcvar_num(mp_freezetime)
}
public message_TextMsg(const MsgId, const MsgDest, const MsgEntity)
{
static message[64]
get_msg_arg_string(2, message, charsmax(message))
if(equal(message, "#Game_Commencing"))
{
hudtimer = get_pcvar_num(cvar)
if(hudtimer == -1)
return
formatex(message, charsmax(message), "Bicak Oyunu Basladi..")
set_msg_arg_string(2, message)
set_task(1.0, "restart", TASKID, _, _, "b")
set_pcvar_num(mp_freezetime, 0)
}
if(equal(message, "#Game_will_restart_in"))
{
formatex(message, charsmax(message), "Bicak Oyunu Bitti.y")
set_msg_arg_string(2, message)
}
}
public restart()
{
if(hudtimer <= 0)
{
remove_task(TASKID)
set_cvar_num("sv_restartround", 1)
set_pcvar_num(mp_freezetime, value)
}
else
{
set_hudmessage(255,255,255,-1.0,0.9,0,6.0,1.0,0.1,0.2)
ShowSyncHudMsg(0, hudhandler, "[ Bicak Oyununun Bitmesine %i Saniye ]", hudtimer)
}
hudtimer--
}
public switchweapon(id)
{
if(task_exists(TASKID))
{
engclient_cmd(id, "weapon_knife")
}
}