Przerobiłem auto restart by PERF, ale mam problem, bo jak na HLDS odpalam to po jakimś czasie crash
Widzi kto jakieś błędy ?
SMA:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define SETHUDMSG set_hudmessage(000, 100, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1); // Niebieski
#define SETHUDMSG1 set_hudmessage(000, 205, 000, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1); // Zielony
#define SETHUDMSG2 set_hudmessage(255, 255, 000, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1); // Żołty
#define SETHUDMSG3 set_hudmessage(000, 255, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1); // Aqa
#define SETHUDMSG4 set_hudmessage(255, 048, 048, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1); // Czerwony
#define SETHUDMSG5 set_hudmessage(255, 127, 000, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1); // Pomarańczowy
#define SETHUDMSG6 set_hudmessage(238, 018, 137, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1); // Rożowy
#define SETHUDMSG7 set_hudmessage(139, 069, 019, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1); // Brązowy
#define SETHUDMSG8 set_hudmessage(155, 048, 255, 0.75, 0.70, 2, 0.02, 1.0, 0.01, 0.1, 1); // Fioletowy
#define SETHUDMSG9 set_hudmessage(250, 100, 100, -1.0, 0.25, 1, 0.02, 1.0, 0.01, 0.1, 1); // (THREE TWO ONE)
#define SETHUDMSG10 set_hudmessage(250, 075, 075, -1.0, 0.25, 1, 0.02, 1.0, 0.01, 0.1, 1); // (THREE TWO ONE)
#define LEVEL_LEVEL ADMIN_CFG
new bool:AutoRR = true
new bool:knifeArena = false
public plugin_init()
{
register_plugin("Auto-Restart-Knives","0.2","PEREF")
register_dictionary("auto_restart_knives.txt")
register_concmd("amx_auto_rr_knives","auto_rr",LEVEL_LEVEL," - 1 : ON | 0 : OFF")
register_cvar("auto_rr_time","120")
register_event("TextMsg","restart_time","a","2Game_C")
register_clcmd("weapony", "wep")
return PLUGIN_CONTINUE
}
public auto_rr(id)
{
if (!(get_user_flags(id)&LEVEL_LEVEL)) {
client_print(id, print_console, "[AMXX] nie masz dostepu do tej funkcji")
return PLUGIN_HANDLED
}
new arg [2]
read_argv(1,arg,1)
if(equal(arg, "1"))
{
AutoRR = true
client_print(id,print_console,"[AMXX] wlaczone")
}
else if(equal(arg, "0"))
{
AutoRR = false
client_print(id,print_console,"[AMXX] wylaczone")
}
else if(!equal(arg, "1") || equal(!arg, "0"))
{
client_print(id,print_console,"amx_auto_rr_knives 1 = On | 0 = Off");
}
return PLUGIN_HANDLED
}
public wep(id)
{
if (!knifeArena)
return PLUGIN_CONTINUE
give_item(id, "weapon_m4a1")
give_item(id, "weapon_deagle")
give_item(id, "weapon_mp5navy")
give_item(id, "weapon_m249")
give_item(id, "weapon_awp")
give_item(id, "weapon_p90")
give_item(id, "weapon_ak47")
set_user_armor(id, 500)
set_user_health(id, 500)
return PLUGIN_CONTINUE
}
public restart_time()
{
if (AutoRR==true)
{
new restart_time=get_cvar_num("auto_rr_time")
knifeArena = true
set_task(float(restart_time),"restart_map",0)
set_task(float(restart_time)-120,"restart_120s",0)
}
}
public restart_120s()
{
set_hudmessage(255, 0, 0, 0.49, 0.37, 0, 6.0, 15.0)
show_hudmessage(0, "Day of the dead!")
client_cmd(0,"mp3 play sound/total_overdose/day_of_the_dead.mp3")
set_task(3.0, "sound")
}
public sound () {
client_cmd(0,"mp3 play sound/total_overdose/day_of_the_dead.mp3")
}
public restart_map()
{
if (AutoRR==true)
{
set_cvar_float("sv_restart",1.0)
knifeArena = false
set_hudmessage(255, 0, 0, 0.49, 0.37, 0, 6.0, 15.0)
show_hudmessage(0, "End ofthe day of the dead!")
}
}
public plugin_precache()
{
precache_sound( "total_overdose/day_of_the_dead.mp3")
return PLUGIN_CONTINUE
}


Dodatki SourceMod



Temat jest zamknięty









