#include <amxmod>
#include <amxmisc>
#include <fun>
new bool:MapSTARTED = false
new rtime = 60 // Czas po 5s od zaladowania pluginu do Restartu w Sekundach
new sname[] = ".........." // Nazwa Serwera (Nie dawac w ch.. dlugich...)
public plugin_init() {
register_plugin("Auto Restart","1.1b","graczu")
set_task(5.0, "start_restart")
return PLUGIN_CONTINUE
}
public start_restart(){
new Float:rtimes = float(rtime)
new Float:rtimeStop = rtimes - 7.0
new Float:rtimeThree = rtimes - 6.0
new Float:rtimeTwo = rtimes - 3.0
new Float:rtimeOne = rtimes
new Float:rtimePlay = rtimes + 3.0
set_task(1.0,"loop_timer", 1100, "", 0, "b")
set_task(5.0,"check_clients", 1101, "", 0, "b")
set_task(rtimeStop,"stop_rool",1900)
set_task(rtimeThree,"say_start",1200)
set_task(rtimeTwo,"say_start",1300)
set_task(rtimeOne,"say_start",1400)
set_task(rtimePlay,"say_start",1500)
new dir[ 64 ]
get_configsdir( dir, 63 )
server_cmd( "exec %s/ar_start.cfg", dir )
}
public stop_rool(){
if(task_exists(1100)){
remove_task(1100)
}
if(task_exists(1101)){
remove_task(1101)
}
}
public loop_timer(){
new col1=random_num(0,255)
new col2=random_num(0,255)
new col3=random_num(0,255)
set_hudmessage(col1, col2, col3, 0.65, 0.75, 2, 0.02, 1.0, 0.01, 0.1, 10)
show_hudmessage(0,"===================^n%s^nRESTART ZA %i SEKUND^n===================", sname, rtime)
rtime--
}
public say_start(data){
if(data == 1200){
client_cmd(0,"spk misc/three.wav")
set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 6.0, 1.0, 0.5, 0.15, 1)
show_hudmessage(0,"Three")
MapSTARTED = true
new dir[ 64 ]
get_configsdir( dir, 63 )
server_cmd( "exec %s/ar_end.cfg", dir )
}
if(data == 1300){
client_cmd(0,"spk misc/two.wav")
set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 6.0, 1.0, 0.5, 0.15, 2)
show_hudmessage(0,"Two")
}
if(data == 1400){
client_cmd(0,"spk misc/one.wav")
set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 6.0, 1.0, 0.5, 0.15, 3)
show_hudmessage(0,"One")
set_task(1.0, "server_restart", 1401)
}
if(data == 1500){
client_cmd(0,"spk misc/reset.wav")
set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 6.0, 4.0, 0.5, 0.15, 4)
show_hudmessage(0,"==========^n* GRAMY *^n==========")
}
}
public server_restart(){
server_cmd("sv_restart 1")
}
public client_death(killer, victim, wpnindex, hitplace, TK)
{
new arg[1]
arg[0] = victim
if(MapSTARTED == false){
set_task(0.5, "spawn_user", victim + 99)
}
}
public check_clients(){
new pnum = get_playersnum()
for(new i = 0; i < pnum; i++){
if(is_user_connected(i) && !is_user_alive(i) && (cs_get_user_team(i) == CS_TEAM_T || cs_get_user_team(i) == CS_TEAM_CT)){
cs_user_spawn(i)
}
}
}
public spawn_user(id){
new cid = id - 99
if(is_user_connected(cid) && !is_user_alive(cid)){
cs_user_spawn(cid)
}
}
public plugin_precache() {
precache_sound("misc/three.wav")
precache_sound("misc/two.wav")
precache_sound("misc/one.wav")
precache_sound("misc/reset.wav")
}Z Gory dziękuje


Dodatki SourceMod



Temat jest zamknięty









