Mam plugin jak w temacie i teraz po 45 sek mam restart, ale nadal mam noż w ręce jak zrobić aby pierwsza runda była nozówka a po restarcie zaczynala sie normalna gra. dzięki
/
#include <amxmod>
new onoff[8]
new bool:AutoRR = true /* Plugin is enabled default - Set to false to disable */
new bool:AutoHud = true /* Plugin uses Hud-Messages - Set to false to use client_say */
new username[32]
new logfilename[256]
public switchweapon(id)
engclient_cmd(id,"weapon_knife")
public amx_auto_rr(id){
if (!(get_user_flags(id)&ADMIN_SLAY)){
client_print(id,print_console,"[AMX] nie masz dostepu do tej komendy!")
return PLUGIN_HANDLED
}
if (read_argc() < 2){
checkmode()
client_print(id,print_console,"[AMX] Uzycie: amx_auto_rr < 0 | 1 > | Aktualnie: * %s *", onoff)
return PLUGIN_HANDLED
}
read_argv(1,onoff,2)
if (equal(onoff,"1", 1)){
AutoRR = true
client_print(id,print_console,"[AMX] Auto-Restart wlaczony!")
if (AutoHud == true){
hudstyle()
}
else {
clientstyle()
}
log_to_file(logfilename,"amx_auto_rr: ^"%s^" wlaczyl Auto-Restart.",get_user_name(id,username,31))
}
else {
AutoRR = false
client_print(id,print_console,"Auto-Restart wylaczony")
if (AutoHud == true){
hudstyle()
}
else {
clientstyle()
}
log_to_file(logfilename,"amx_auto_rr: ^"%s^" wylaczyl Auto-Restart.",get_user_name(id,username,31))
}
return PLUGIN_HANDLED
}
public checkmode() {
if(AutoRR == true){
copy(onoff, 8, "enabled")
}
else {
copy(onoff, 8, "disabled")
}
return PLUGIN_CONTINUE
}
public auto_tasks()
{
set_hudmessage( 000, 100, 255, -1.0, 0.25, 0, 6.0, 12.0, 0.1, 0.2, 4)
show_hudmessage(0,"Auto - Restart za 45 sek.")
set_task(18.0,"auto_rr_1",0)
set_task(33.0,"auto_rr_2",0)
set_task(43.0,"auto_rr_3",0)
set_task(44.0,"auto_rr_4",0)
set_task(45.0,"auto_rr_5",0)
set_task(46.0,"auto_rr_6",0)
set_task(47.0,"auto_rr_7",0)
set_task(48.0,"auto_rr_8",0)
}
public auto_rr_1()
{
set_hudmessage(000, 100, 255, -1.0, 0.25, 0, 6.0, 12.0, 0.1, 0.2, 4)
show_hudmessage(0,"Auto - Restart za 30 sek")
}
public auto_rr_2()
{
set_hudmessage(000, 100, 255, -1.0, 0.25, 0, 6.0, 12.0, 0.1, 0.2, 4)
show_hudmessage(0,"Auto - Restart za 15 sek")
}
public auto_rr_3()
{
set_hudmessage(000, 100, 255, -1.0, 0.25, 0, 6.0, 1.0, 0.1, 0.2, 4)
show_hudmessage(0,"Auto - Restart za 5 sek")
}
public auto_rr_4()
{
set_hudmessage(000, 100, 255, -1.0, 0.25, 0, 6.0, 1.0, 0.1, 0.2, 4)
show_hudmessage(0,"Auto - Restart za 4 sek")
}
public auto_rr_5()
{
set_hudmessage(000, 100, 255, -1.0, 0.25, 0, 6.0, 1.0, 0.1, 0.2, 4)
show_hudmessage(0,"Auto - Restart za 3 sek")
}
public auto_rr_6()
{
set_hudmessage(000, 100, 255, -1.0, 0.25, 0, 6.0, 1.0, 0.1, 0.2, 4)
show_hudmessage(0,"Auto - Restart za 2 sek")
}
public auto_rr_7()
{
set_hudmessage(000, 100, 255, -1.0, 0.25, 0, 6.0, 1.0, 0.1, 0.2, 4)
show_hudmessage(0,"Auto - Restart za 1 sek")
}
public auto_rr_8()
{
set_hudmessage(000, 100, 255, -1.0, 0.25, 0, 6.0, 1.0, 0.1, 0.2, 4)
show_hudmessage(0,"Auto - Restart !!!")
client_cmd(0,"spk misc/trabka.wav")
}
public hudstyle() {
new message[128]
checkmode()
format(message,127,"Auto-Restart",onoff)
set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2)
show_hudmessage(0,message)
return PLUGIN_CONTINUE
}
public clientstyle() {
new message[128]
checkmode()
format(message,127,"Auto-Restart",onoff)
client_print(0,print_chat,message)
}
public restart_time(){
set_task (2.0,"restart_knives")
set_task (get_cvar_float("amx_auto_rr_time"),"restart_map",0)
}
public restart_knives() {
if (get_cvar_num("amx_auto_rr_knives")==0){
pause("b","switchweapon")
server_cmd("amx unpause antirusher.amx")
}
else{
unpause("b","switchweapon")
server_cmd("amx pause antirusher.amx")
}
}
public restart_map() {
if (AutoRR==true){
set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2)
show_hudmessage(0,"Milego fragowania i dobrej zabawy !")
set_cvar_float("sv_restart",2.0)
unpause("b","switchweapon")
server_cmd("amx unpause antirusher.amx")
}
else {
client_print(0,print_chat,"[AMX] Autorestart wylaczony, nie mozna uruchomic autorestartu!")
}
}
public plugin_init() {
register_plugin("Auto-Restart","1.1.0","-ThX-")
register_event("TextMsg","restart_time","a","2Game_C")
register_event("TextMsg","auto_tasks","a","2Game_C")
register_cvar("amx_auto_rr_time","45.0")
register_cvar("amx_auto_rr_knives","0")
register_clcmd("amx_auto_rr","amx_auto_rr",ADMIN_SLAY,"amx_auto_rr : < 0 | 1> Turns ability to Auto-Restart (Game Commencing) on and off")
get_time("addons/amx/logs/admin%m%d.log",logfilename,255)
register_event("CurWeapon","switchweapon","be","1=1","2!29")
pause("b","switchweapon")
return PLUGIN_CONTINUE
}


Dodatki SourceMod



Temat jest zamknięty









