ты мне еше будешь что то говоить? лоло?
пали код /* AMXMOD X script.
*
* © Copyright 2007, jas0n
* This file is provided as is (no warranties).
*
* v1.0 - initial release
* v1.1 - show_hudmessage() changed to ShowSyncHudMsg()
*
*/
#include <amxmodx>
#include <amxmisc>
new const PLUGIN_NAME[] = "Auto Restart Game"
new const PLUGIN_VERSION[] = "1.1.1"
new const PLUGIN_AUTHOR[] = "by deda"
new const USAGE[] = "amx_restartgame - restart game in 15 sec"
//new const CENTER_MSG[] = "Удачной Игры!"
new const CENTER_MSG[] = "Удачной игры!"
new const RESTART_IN_MSG[] = "Авто рестарт через %d секунд[ы]!"
//#define SET_RESTART_IN_MSG 006, 400, 0, 0.04, 0.65, 0, 0.0, 1.1, 0.0, 0.0, 3
#define SET_RESTART_IN_MSG 006, 400, 0, 0.66, 0.04, 0, 0.0, 1.1, 0.0, 0.0, 3
#define SET_CENTER_MSG 006, 400, 0, -1.0, 0.40, 1, 6.0, 2.0, 0.1, 0.1, 3
#define TASK_ID 93417
//#define RESTART_IN_SECONDS 30
new g_Timer
new gHudSync
new pcvar_amx_restarttime, pcvar_amx_restartcentrmsg
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_clcmd("amx_restartgame", "autoRestart", ADMIN_CFG, USAGE)
// register_event("TextMsg", "autoRestart", "a", "2=#Game_Commencing")
pcvar_amx_restarttime = register_cvar("amx_restarttime","45")
pcvar_amx_restartcentrmsg = register_cvar("amx_restartcentrmsg","1")
set_task(1.0, "autoRestart")
gHudSync = CreateHudSyncObj()
}
public autoRestart(id, level, cid)
{
if (!cmd_access(id, level, cid, 0))
return PLUGIN_CONTINUE
set_cvar_num("mp_friendlyfire", 0)
g_Timer = get_pcvar_num(pcvar_amx_restarttime)
set_task(1.0, "restInMsg", TASK_ID, _, _, "a", get_pcvar_num(pcvar_amx_restarttime))
return PLUGIN_HANDLED
}
public restInMsg()
{
set_hudmessage(SET_RESTART_IN_MSG)
// show_hudmessage(0, RESTART_IN_MSG, g_Timer)
ShowSyncHudMsg(0, gHudSync, RESTART_IN_MSG, g_Timer)
if (--g_Timer == 0)
restRound()
}
public restRound()
{
if(task_exists(TASK_ID))
remove_task(TASK_ID)
set_cvar_num("sv_restart", 3)
set_task(3.0, "centerMsg")
}
public centerMsg()
{
set_cvar_num("mp_friendlyfire", 1) вот !!!!! даже если ставишь 0 серавно урон есть!
if (get_pcvar_num(pcvar_amx_restartcentrmsg))
{
set_hudmessage(SET_CENTER_MSG)
// show_hudmessage(0, CENTER_MSG)
ShowSyncHudMsg(0, gHudSync, CENTER_MSG)
}
}