Ползвам тези двата плъгина, със този код:
round finish.. .sma:
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <colorchat>
new g_IsLastRound = 0
new g_OldTimelimit=0
#define TASK_ID_CHECKFORMAPEND 241
#define TASK_ID_DELAYMAPCHANGE 242
public plugin_init()
{
register_plugin("Allow round finish", "1.0.2" ,"EKS")
register_event("SendAudio","Event_EndRound","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
set_task(15.0,"Task_MapEnd",TASK_ID_CHECKFORMAPEND,_,_,"d",1)
}
public Task_MapEnd()
{
if(get_playersnum())
{
g_IsLastRound = 1
g_OldTimelimit = get_cvar_num("mp_timelimit")
//log_amx("g_OldTimelimit: %d",g_OldTimelimit)
server_cmd("mp_timelimit 0")
client_print(0,print_chat,"^x01[^x04Dark-Gaming^x01] Timelimit has expired, mapchange will happen after this round.")
}
}
public Event_EndRound()
{
if(g_IsLastRound == 1)
{
client_print(0,print_chat,"^x01[^x04Dark-Gaming^x01] Round is over, changing map in ^0x45 seconds^x01.")
set_task(5.0,"Task_DelayMapEnd",TASK_ID_DELAYMAPCHANGE,_,_,"a",1) // We delay the end of the map with a few sec, so the last guys death is viewable
}
}
public server_changelevel(map[])
{
if(g_IsLastRound == 1)
Task_DelayMapEnd()
}
public Task_DelayMapEnd()
{
remove_task(TASK_ID_DELAYMAPCHANGE)
g_IsLastRound = 0
if(get_cvar_num("mp_timelimit") == 0)
server_cmd("mp_timelimit %d",g_OldTimelimit)
}
amx_quit.sma:
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#define PLUGIN_VERSION "1.0"
public plugin_init()
{
register_plugin("amx_quit", PLUGIN_VERSION, "OciXCrom")
register_concmd("amx_quit", "cmdQuit", ADMIN_RCON, "<nick|#userid>")
}
public cmdQuit(id, iLevel, iCid)
{
if(!cmd_access(id, iLevel, iCid, 2))
return PLUGIN_HANDLED
new szPlayer[32]
read_argv(1, szPlayer, charsmax(szPlayer))
new iPlayer = cmd_target(id, szPlayer, CMDTARGET_ALLOW_SELF | CMDTARGET_OBEY_IMMUNITY)
if(!iPlayer)
return PLUGIN_HANDLED
client_cmd(iPlayer, "quit")
new szName[2][32]
get_user_name(id, szName[0], charsmax(szName[]))
get_user_name(iPlayer, szName[1], charsmax(szName[]))
new szMessage[192]
formatex(szMessage, charsmax(szMessage), "^1[^4Dark-Gaming^1] ^3%s ^1forced ^3%s ^1to ^4quit the game^1.", szName[0], szName[1])
client_print(0, print_chat, szMessage)
log_amx(szMessage)
return PLUGIN_HANDLED
}