#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Mapcykl Night/Day"
#define VERSION "1.0"
#define AUTHOR " "
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
wczytaj_mapcycle()
return PLUGIN_CONTINUE
}
public wczytaj_mapcycle() {
new today_str[8], cmd[48]
get_time("%H",today_str,8)
new today = str_to_num(today_str)
if ((today >= 22) && (today < 8))
format(cmd,48,"mapcyclefile mapcycle-night.cfg",today)
else if ((today >= 8) || (today < 22))
format(cmd,48,"mapcyclefile mapcycle-day.cfg",today)
server_cmd(cmd)
return PLUGIN_HANDLED
}
i chce go przerobic zeby mapcykle zaczynaly sie o 24 i o 11 to bedzie wygladalo tak ?
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Mapcykl Night/Day"
#define VERSION "1.0"
#define AUTHOR " "
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
wczytaj_mapcycle()
return PLUGIN_CONTINUE
}
public wczytaj_mapcycle() {
new today_str[8], cmd[48]
get_time("%H",today_str,8)
new today = str_to_num(today_str)
if ((today >= 24) && (today < 11))
format(cmd,48,"mapcyclefile mapcycle-night.cfg",today)
else if ((today >= 11) || (today < 24))
format(cmd,48,"mapcyclefile mapcycle-day.cfg",today)
server_cmd(cmd)
return PLUGIN_HANDLED
}