#include < amxmodx >
#include < nvault >
#if AMXX_VERSION_NUM < 183
#include colorchat
#endif
new hNvault, connects, gMax, round_count, connect[33], current_map[32];
#define TASK 92512
public plugin_init(){
register_plugin("InfoConnects", "1.0", "PAffAEJIkA :3");
nvOpen();
connects = nvault_get(hNvault, "CONNECTS");
new szDate[16], szData[16]; get_time("%H:%M", szDate, charsmax(szDate));
strtok(szDate, szDate, charsmax(szDate), szData, charsmax(szData), ':');
if(str_to_num(szDate) == 23){
new szTime = (60 - str_to_num(szData)) * 60;
set_task(float(szTime), "changeVault", TASK);
}
gMax = get_maxplayers();
get_mapname(current_map, charsmax(current_map));
register_event("TextMsg", "eventGameRestart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in");
register_logevent("round_start", 2, "1=Round_Start");
}
public eventGameRestart()
round_count = 0;
public client_putinserver(id){
if(is_user_bot(id) || is_user_hltv(id))
return;
new szSteam[35];
get_user_authid(id, szSteam, charsmax(szSteam));
connect[id] = nvault_get(hNvault, szSteam);
if(!connect[id]){
connects ++;
new string[8];
formatex(string, charsmax(string), "%d", connects);
nvault_set(hNvault, "CONNECTS", string);
nvault_set(hNvault, szSteam, "1");
}
}
public round_start()
client_print_color(0, -2, "^1[^4GFS^1] Раунд: ^4%d ^3|^1 Играет: ^4%d^1/^4%d ^3|^1 Сыграло: ^4%d ^3| ^1Карта: ^4%s ", ++round_count, get_playersnum(), gMax, connects, current_map);
public nvOpen(){
new szDate[3];
get_time("%d", szDate, charsmax(szDate));
new szVName[64];
formatex(szVName, charsmax(szVName), "CONNECTS%d", str_to_num(szDate));
hNvault = nvault_open(szVName);
if(hNvault == INVALID_HANDLE)
set_fail_state("Fail open NVAULT file!");
new szFile[128];
formatex(szFile, charsmax(szFile), "addons/amxmodx/data/vault/CONNECTS%d.vault", str_to_num(szDate) - 2);
if(file_exists(szFile))
delete_file(szFile);
}
public changeVault(){
new players[32];
get_players(players, connects, "ch");
nvault_close(hNvault);
nvOpen();
}
client_print_color(0, -2, "^1[^4GFS^1] Раунд: ^4%d ^3|^1 Играет: ^4%d^1/^4%d ^3|^1 Сыграло: ^4%d ^3| ^1Карта: ^4%s ", ++round_count, get_playersnum(), gMax, connects, current_map);
#include < amxmodx >
#include < nvault >
#include < colorchat >
new hNvault, connects, gMax, connect[33];
#define TASK 92512
public plugin_init(){
register_plugin("InfoConnects", "1.0", "PAffAEJIkA :3");
nvOpen();
connects = nvault_get(hNvault, "CONNECTS");
new szDate[16], szData[16]; get_time("%H:%M", szDate, charsmax(szDate));
strtok(szDate, szDate, charsmax(szDate), szData, charsmax(szData), ':');
if(str_to_num(szDate) == 23){
new szTime = (60 - str_to_num(szData)) * 60;
set_task(float(szTime), "changeVault", TASK);
}
gMax = get_maxplayers();
register_logevent("round_start", 2, "1=Round_Start");
}
public client_putinserver(id){
if(is_user_bot(id) || is_user_hltv(id))
return;
new szSteam[35];
get_user_authid(id, szSteam, charsmax(szSteam));
connect[id] = nvault_get(hNvault, szSteam);
if(!connect[id]){
connects ++;
new string[8];
formatex(string, charsmax(string), "%d", connects);
nvault_set(hNvault, "CONNECTS", string);
nvault_set(hNvault, szSteam, "1");
}
}
public round_start()
client_print_color(0, 0, "^3[^4MSTATS^3] Сейчас на сервере:^4 %d/%d^3. Всего сегодня заходило^4 %d^3 человек(а)!", get_playersnum(), gMax, connects);
public nvOpen(){
new szDate[3];
get_time("%d", szDate, charsmax(szDate));
new szVName[64];
formatex(szVName, charsmax(szVName), "CONNECTS%d", str_to_num(szDate));
hNvault = nvault_open(szVName);
if(hNvault == INVALID_HANDLE)
set_fail_state("Fail open NVAULT file!");
new szFile[128];
formatex(szFile, charsmax(szFile), "addons/amxmodx/data/vault/CONNECTS%d.vault", str_to_num(szDate) - 2);
if(file_exists(szFile))
delete_file(szFile);
}
public changeVault(){
new players[32];
get_players(players, connects, "ch");
nvault_close(hNvault);
nvOpen();
}