Untitled diff

Created Diff never expires
#pragma semicolon 1
#pragma semicolon 1


#include <sourcemod>
#include <sourcemod>
#include <sdktools>
#include <sdktools>
#include <geoip>
#include <geoip>
#include <cstrike>
#include <cstrike>
#include <warmod>
#include <warmod>
#include <warmod_configs>
#include <warmod_configs>
#undef REQUIRE_PLUGIN
#undef REQUIRE_PLUGIN
#include <adminmenu>
#include <adminmenu>
#include <updater>
#include <updater>
#include <tEasyFTP>
#include <tEasyFTP>
#undef REQUIRE_EXTENSIONS
#undef REQUIRE_EXTENSIONS
#include <bzip2>
#include <bzip2>
#include <zip>
#include <zip>


#pragma newdecls required
#pragma newdecls required


bool SQL_DEBUG = false;
bool SQL_DEBUG = false;




int g_player_list[MAXPLAYERS + 1];
int g_player_list[MAXPLAYERS + 1];
bool g_cancel_list[MAXPLAYERS + 1];
bool g_cancel_list[MAXPLAYERS + 1];
int g_scores[2][2];
int g_scores[2][2];
int g_scores_overtime[2][256][2];
int g_scores_overtime[2][256][2];
int g_overtime_count = 0;
int g_overtime_count = 0;


/* miscellaneous */
/* miscellaneous */
char g_map[64];
char g_map[64];
char date[32];
char date[32];
char startHour[4];
char startHour[4];
char startMin[4];
char startMin[4];
float g_match_start;
float g_match_start;


/* SQL and Last Match settings */
/* SQL and Last Match settings */
Handle hDatabase = INVALID_HANDLE;
Handle hDatabase = INVALID_HANDLE;
ConVar wm_upload_results;
ConVar wm_upload_results;
ConVar wm_table_name;
ConVar wm_table_name;
//ConVar wm_table_name_players;
//ConVar wm_table_name_players;
ConVar wm_table_round_stats;
ConVar wm_table_round_stats;
int lt_match_length;
int lt_match_length;
char lt_map[64];
char lt_map[64];
int lt_max_rounds;
int lt_max_rounds;
int lt_overtime_max_rounds;
int lt_overtime_max_rounds;
int lt_overtime_count;
int lt_overtime_count;
int lt_played_out;
int lt_played_out;
char lt_t_name[64];
char lt_t_name[64];
int lt_t_overall_score;
int lt_t_overall_score;
int lt_t_first_half_score;
int lt_t_first_half_score;
int lt_t_second_half_score;
int lt_t_second_half_score;
int lt_t_overtime_score;
int lt_t_overtime_score;
char lt_ct_name[64];
char lt_ct_name[64];
int lt_ct_overall_score;
int lt_ct_overall_score;
int lt_ct_first_half_score;
int lt_ct_first_half_score;
int lt_ct_second_half_score;
int lt_ct_second_half_score;
int lt_ct_overtime_score;
int lt_ct_overtime_score;
char lt_log_file_name[128];
char lt_log_file_name[128];
//char sql_steamid64[MAXPLAYERS + 1][64];
//char sql_steamid64[MAXPLAYERS + 1][64];
//char sql_player_name[MAXPLAYERS + 1][64];
//char sql_player_name[MAXPLAYERS + 1][64];
//int sql_player_team[MAXPLAYERS + 1];
//int sql_player_team[MAXPLAYERS + 1];
//int sql_player_count;
//int sql_player_count;
int match_id;
int match_id;


// Offsets
// Offsets
int g_iAccount = -1;
int g_iAccount = -1;


/* stats */
/* stats */
bool g_log_warmod_dir = false;
bool g_log_warmod_dir = false;
char g_log_filename[128];
char g_log_filename[128];
Handle g_log_file = INVALID_HANDLE;
Handle g_log_file = INVALID_HANDLE;
char g_log_veto_filename[128];
char g_log_veto_filename[128];
Handle g_log_veto_file = INVALID_HANDLE;
Handle g_log_veto_file = INVALID_HANDLE;
char weapon_list[][] = {"ak47", "m4a1_silencer", "m4a1_silencer_off", "m4a1", "galilar", "famas", "awp", "p250", "cz75a", "glock", "hkp2000", "usp_silencer", "usp_silencer_off", "ump45", "p90", "bizon", "mp7", "nova", "knife", "elite", "fiveseven", "deagle", "revolver", "tec9", "ssg08", "scar20", "aug", "sg556", "g3sg1", "mac10", "mp9", "mag7", "negev", "m249", "sawedoff", "incgrenade", "flashbang", "smokegrenade", "hegrenade", "molotov", "decoy", "taser"};
char weapon_list[][] = {"ak47", "m4a1_silencer", "m4a1_silencer_off", "m4a1", "galilar", "famas", "awp", "p250", "cz75a", "glock", "hkp2000", "usp_silencer", "usp_silencer_off", "ump45", "p90", "bizon", "mp7", "nova", "knife", "elite", "fiveseven", "deagle", "revolver", "tec9", "ssg08", "scar20", "aug", "sg556", "g3sg1", "mac10", "mp9", "mag7", "negev", "m249", "sawedoff", "incgrenade", "flashbang", "smokegrenade", "hegrenade", "molotov", "decoy", "taser"};
int weapon_stats[MAXPLAYERS + 1][NUM_WEAPONS][LOG_HIT_NUM];
int weapon_stats[MAXPLAYERS + 1][NUM_WEAPONS][LOG_HIT_NUM];
int clutch_stats[MAXPLAYERS + 1][CLUTCH_NUM];
int clutch_stats[MAXPLAYERS + 1][CLUTCH_NUM];
int assist_stats[MAXPLAYERS + 1][ASSIST_NUM];
int assist_stats[MAXPLAYERS + 1][ASSIST_NUM];
int round_health[MAXPLAYERS + 1];
int round_health[MAXPLAYERS + 1];
int g_round = 1;
int g_round = 1;
char last_weapon[MAXPLAYERS + 1][64];
char last_weapon[MAXPLAYERS + 1][64];
char force_team_t[10][64];
char force_team_t[10][64];
char force_team_ct[10][64];
char force_team_ct[10][64];
int force_team_t_count = 0;
int force_team_t_count = 0;
int force_team_ct_count = 0;
int force_team_ct_count = 0;
bool g_planted = false;
bool g_planted = false;
Handle g_stats_trace_timer = INVALID_HANDLE;
Handle g_stats_trace_timer = INVALID_HANDLE;
ConVar wm_competition;
ConVar wm_competition;
ConVar wm_event;
ConVar wm_event;
char g_competition[255];
char g_competition[255];
char g_event[255];
char g_event[255];
char g_server[255];
char g_server[255];


/* forwards */
/* forwards */
Handle g_f_on_lo3 = INVALID_HANDLE;
Handle g_f_on_lo3 = INVALID_HANDLE;
Handle g_f_on_round_end = INVALID_HANDLE;
Handle g_f_on_round_end = INVALID_HANDLE;
Handle g_f_on_half_time = INVALID_HANDLE;
Handle g_f_on_half_time = INVALID_HANDLE;
Handle g_f_on_reset_half = INVALID_HANDLE;
Handle g_f_on_reset_half = INVALID_HANDLE;
Handle g_f_on_reset_match = INVALID_HANDLE;
Handle g_f_on_reset_match = INVALID_HANDLE;
Handle g_f_on_end_match = INVALID_HANDLE;
Handle g_f_on_end_match = INVALID_HANDLE;
Handle g_f_livewire_log_event = INVALID_HANDLE;
Handle g_f_livewire_log_event = INVALID_HANDLE;


/* cvars */
/* cvars */
ConVar wm_active;
ConVar wm_active;
ConVar wm_stats_enabled;
ConVar wm_stats_enabled;
ConVar wm_stats_method;
ConVar wm_stats_method;
ConVar wm_stats_trace;
ConVar wm_stats_trace;
ConVar wm_stats_trace_delay;
ConVar wm_stats_trace_delay;
ConVar wm_rcon_only;
ConVar wm_rcon_only;
ConVar wm_lock_teams;
ConVar wm_lock_teams;
ConVar wm_min_ready;
ConVar wm_min_ready;
ConVar wm_max_players;
ConVar wm_max_players;
ConVar wm_match_config;
ConVar wm_match_config;
ConVar wm_reset_config;
ConVar wm_reset_config;
ConVar wm_reset_config_delay;
ConVar wm_reset_config_delay;
ConVar wm_warmup_config;
ConVar wm_warmup_config;
ConVar wm_prac_config;
ConVar wm_prac_config;
ConVar wm_playout_config;
ConVar wm_playout_config;
ConVar wm_overtime_config;
ConVar wm_overtime_config;
ConVar wm_default_config;
ConVar wm_default_config;
ConVar wm_knife_config;
ConVar wm_knife_config;
ConVar wm_half_time_break;
ConVar wm_half_time_break;
ConVar wm_over_time_break;
ConVar wm_over_time_break;
ConVar wm_round_money;
ConVar wm_round_money;
ConVar wm_ingame_scores;
ConVar wm_ingame_scores;
ConVar mp_maxrounds;
ConVar mp_maxrounds;
ConVar wm_block_warm_up_grenades;
ConVar wm_block_warm_up_grenades;
ConVar wm_knife_auto_start;
ConVar wm_knife_auto_start;
ConVar wm_knife_hegrenade;
ConVar wm_knife_hegrenade;
ConVar wm_knife_flashbang;
ConVar wm_knife_flashbang;
ConVar wm_knife_smokegrenade;
ConVar wm_knife_smokegrenade;
ConVar wm_knife_zeus;
ConVar wm_knife_zeus;
ConVar wm_knife_armor;
ConVar wm_knife_armor;
ConVar wm_knife_helmet;
ConVar wm_knife_helmet;
ConVar wm_require_names;
ConVar wm_require_names;
ConVar wm_require_logos;
ConVar wm_require_logos;
ConVar wm_logos_menu_only;
ConVar wm_logos_menu_only;
ConVar wm_show_info;
ConVar wm_show_info;
ConVar wm_auto_ready;
ConVar wm_auto_ready;
ConVar wm_auto_knife;
ConVar wm_auto_knife;
ConVar mp_overtime_enable;
ConVar mp_overtime_enable;
ConVar mp_overtime_maxrounds;
ConVar mp_overtime_maxrounds;
ConVar tv_enable;
ConVar tv_enable;
ConVar wm_auto_record;
ConVar wm_auto_record;
ConVar wm_save_dir;
ConVar wm_save_dir;
ConVar wm_prefix_logs;
ConVar wm_prefix_logs;
ConVar wm_warmup_respawn;
ConVar wm_warmup_respawn;
ConVar wm_chat_prefix;
ConVar wm_chat_prefix;
ConVar mp_match_can_clinch;
ConVar mp_match_can_clinch;
ConVar mp_teamname_1;
ConVar mp_teamname_1;
ConVar mp_teamname_2;
ConVar mp_teamname_2;
ConVar mp_teamlogo_1;
ConVar mp_teamlogo_1;
ConVar mp_teamlogo_2;
ConVar mp_teamlogo_2;
ConVar mp_teamflag_1;
ConVar mp_teamflag_1;
ConVar mp_teamflag_2;
ConVar mp_teamflag_2;
ConVar wm_ready_tag;
ConVar wm_ready_tag;
ConVar wm_ready_panel;
ConVar wm_ready_panel;




ConVar mp_startmoney;
ConVar mp_startmoney;
ConVar hostname;
ConVar hostname;


/* ready system */
/* ready system */
Handle g_m_ready_up = INVALID_HANDLE;
Handle g_m_ready_up = INVALID_HANDLE;
bool g_ready_enabled = false;
bool g_ready_enabled = false;


/* switches */
/* switches */
bool g_active = true;
bool g_active = true;
bool g_start = false;
bool g_start = false;
bool g_match = false;
bool g_match = false;
bool g_max_lock = false;
bool g_max_lock = false;
bool g_live = false;
bool g_live = false;
bool g_log_live = false;
bool g_log_live = false;
bool g_restore = false;
bool g_restore = false;
bool g_half_swap = true;
bool g_half_swap = true;
bool g_first_half = true;
bool g_first_half = true;
bool g_overtime = false;
bool g_overtime = false;
bool g_t_money = false;
bool g_t_money = false;
bool g_t_score = false;
bool g_t_score = false;
bool g_t_knife = true;
bool g_t_knife = true;
bool g_t_had_knife = false;
bool g_t_had_knife = false;
bool g_second_half_first = false;
bool g_second_half_first = false;
bool g_setNameLimiter = true;
bool g_setNameLimiter = true;
bool g_DispInfoLimiter = true;
bool g_DispInfoLimiter = true;
bool LiveOn2 = false;
bool LiveOn2 = false;
bool LiveOn1 = false;
bool LiveOn1 = false;
bool LiveOn3Text = false;
bool LiveOn3Text = false;
bool KnifeOn2 = false;
bool KnifeOn2 = false;
bool KnifeOn1 = false;
bool KnifeOn1 = false;
bool KnifeOn3Text = false;
bool KnifeOn3Text = false;
bool g_p_ct_name = false;
bool g_p_ct_name = false;
bool g_p_t_name = false;
bool g_p_t_name = false;
int g_knife_winner = 0;
int g_knife_winner = 0;
bool g_knife_vote = false;
bool g_knife_vote = false;
bool captain_file_checked_t = false;
bool captain_file_checked_t = false;
bool captain_file_checked_ct = false;
bool captain_file_checked_ct = false;


/* FTP Auto upload code [By Thrawn from tAutoDemoUpload] */
/* FTP Auto upload code [By Thrawn from tAutoDemoUpload] */
ConVar wm_autodemoupload_enable;
ConVar wm_autodemoupload_enable;
ConVar wm_autodemoupload_bzip2;
ConVar wm_autodemoupload_bzip2;
ConVar wm_autodemoupload_ftptargetdemo;
ConVar wm_autodemoupload_ftptargetdemo;
ConVar wm_autodemoupload_ftptargetlog;
ConVar wm_autodemoupload_ftptargetlog;
char g_sFtpTargetDemo[255];
char g_sFtpTargetDemo[255];
char g_sFtpTargetLog[255];
char g_sFtpTargetLog[255];
ConVar wm_autodemoupload_delete;
ConVar wm_autodemoupload_delete;
char g_sDemoPath[PLATFORM_MAX_PATH];
char g_sDemoPath[PLATFORM_MAX_PATH];
char g_sDemoName[64];
char g_sDemoName[64];
char g_sLogPath[PLATFORM_MAX_PATH];
char g_sLogPath[PLATFORM_MAX_PATH];
bool g_bRecording = false;
bool g_bRecording = false;
ConVar wm_autodemoupload_completed;
ConVar wm_autodemoupload_completed;
bool g_MatchComplete = false;
bool g_MatchComplete = false;


/* Warmod safemode */
/* Warmod safemode */
ConVar wm_warmod_safemode;
ConVar wm_warmod_safemode;


/* modes */
/* modes */
int g_overtime_mode = 0;
int g_overtime_mode = 0;


/* chat prefix */
/* chat prefix */
char CHAT_PREFIX[64];
char CHAT_PREFIX[64];


/* teams */
/* teams */
char g_t_name[64];
char g_t_name[64];
char g_t_name_escaped[64]; // pre-escaped for warmod logs
char g_t_name_escaped[64]; // pre-escaped for warmod logs
char g_ct_name[64];
char g_ct_name[64];
char g_ct_name_escaped[64]; // pre-escaped for warmod logs
char g_ct_name_escaped[64]; // pre-escaped for warmod logs


/* clan tag */
/* clan tag */
char g_clanTags[MAXPLAYERS +1 ][MAX_NAME_LENGTH];
char g_clanTags[MAXPLAYERS +1 ][MAX_NAME_LENGTH];
bool g_clanTagsChecked[MAXPLAYERS + 1] = false;
bool g_clanTagsChecked[MAXPLAYERS + 1] = false;


/* Config Offers */
/* Config Offers */
bool default_offer_ct = false;
bool default_offer_ct = false;
bool default_offer_t = false;
bool default_offer_t = false;
Handle g_h_stored_timer_def = INVALID_HANDLE;
Handle g_h_stored_timer_def = INVALID_HANDLE;


bool overtime_offer_ct = false;
bool overtime_offer_ct = false;
bool overtime_offer_t = false;
bool overtime_offer_t = false;
Handle g_h_stored_timer_ot = INVALID_HANDLE;
Handle g_h_stored_timer_ot = INVALID_HANDLE;


bool playout_offer_ct = false;
bool playout_offer_ct = false;
bool playout_offer_t = false;
bool playout_offer_t = false;
Handle g_h_stored_timer_pl = INVALID_HANDLE;
Handle g_h_stored_timer_pl = INVALID_HANDLE;




/* Pause and Unpause */
/* Pause and Unpause */
bool g_pause_freezetime = false;
bool g_pause_freezetime = false;
bool g_pause_offered_t = false;
bool g_pause_offered_t = false;
bool g_pause_offered_ct = false;
bool g_pause_offered_ct = false;
bool g_auto_pause = false;
bool g_auto_pause = false;
bool FreezeTime = false;
bool FreezeTime = false;


ConVar sv_pausable;
ConVar sv_pausable;
ConVar sv_matchpause_auto_5v5;
ConVar sv_matchpause_auto_5v5;
ConVar wm_auto_pause;
ConVar wm_auto_pause;
ConVar wm_auto_unpause;
ConVar wm_auto_unpause;
ConVar wm_auto_unpause_delay;
ConVar wm_auto_unpause_delay;
ConVar wm_pause_confirm;
ConVar wm_pause_confirm;
ConVar wm_unpause_confirm;
ConVar wm_unpause_confirm;
ConVar wm_pause_limit;
ConVar wm_pause_limit;
int g_t_pause_count = 0;
int g_t_pause_count = 0;
int g_ct_pause_count = 0;
int g_ct_pause_count = 0;
Handle g_h_stored_timer = INVALID_HANDLE;
Handle g_h_stored_timer = INVALID_HANDLE;
Handle g_h_stored_timer_p = INVALID_HANDLE;
Handle g_h_stored_timer_p = INVALID_HANDLE;


char g_c_backup[128];
char g_c_backup[128];


/* Veto Settings */
/* Veto Settings */
ConVar wm_pugsetup_maplist_file;
ConVar wm_pugsetup_maplist_file;
ConVar wm_pugsetup_randomize_maps;
ConVar wm_pugsetup_randomize_maps;
Handle g_MapNames = INVALID_HANDLE;
Handle g_MapNames = INVALID_HANDLE;
Handle g_MapVetoed = INVALID_HANDLE;
Handle g_MapVetoed = INVALID_HANDLE;
ConVar wm_veto;
ConVar wm_veto;
ConVar wm_veto_bo3;
ConVar wm_veto_bo3;
ConVar wm_veto_random;
ConVar wm_veto_random;
ConVar wm_veto_select;
ConVar wm_veto_select;
ConVar wm_veto_knife;
ConVar wm_veto_knife;
ConVar tv_delaymapchange;
ConVar tv_delaymapchange;
ConVar tv_delay;
ConVar tv_delay;
ConVar mp_match_end_restart;
ConVar mp_match_end_restart;
ConVar wm_captain_from_file;
ConVar wm_captain_from_file;
int g_bo3_count = -1;
int g_bo3_count = -1;
int g_bo5_count = -1;
int g_bo5_count = -1;
int g_ChosenMapBo2[2] = -1;
int g_ChosenMapBo2[2] = -1;
int g_ChosenMapBo3[3] = -1;
int g_ChosenMapBo3[3] = -1;
int g_ChosenMapBo5[5] = -1;
int g_ChosenMapBo5[5] = -1;
int g_ChosenMap = -1;
int g_ChosenMap = -1;
int g_MapListCount = 0;
int g_MapListCount = 0;
bool g_veto_s = false;
bool g_veto_s = false;
bool g_t_veto = false;
bool g_t_veto = false;
bool g_veto_active = false;
bool g_veto_active = false;
bool g_veto_bo5_active = false;
bool g_veto_bo5_active = false;
bool g_veto_bo3_active = false;
bool g_veto_bo3_active = false;
bool g_veto_bo2_active = false;
bool g_veto_bo2_active = false;
int g_veto_map_number = 0;
int g_veto_map_number = 0;
int g_veto_number = 0;
int g_veto_number = 0;
int g_capt1 = -1;
int g_capt1 = -1;
int g_capt2 = -1;
int g_capt2 = -1;
bool veto_offer_ct = false;
bool veto_offer_ct = false;
bool veto_offer_t = false;
bool veto_offer_t = false;
Handle g_h_stored_timer_v = INVALID_HANDLE;
Handle g_h_stored_timer_v = INVALID_HANDLE;


/* Print Damage */
/* Print Damage */
int g_DamageDone[MAXPLAYERS+1][MAXPLAYERS+1];
int g_DamageDone[MAXPLAYERS+1][MAXPLAYERS+1];
int g_DamageDoneHits[MAXPLAYERS+1][MAXPLAYERS+1];
int g_DamageDoneHits[MAXPLAYERS+1][MAXPLAYERS+1];
bool g_GotKill[MAXPLAYERS+1][MAXPLAYERS+1];
bool g_GotKill[MAXPLAYERS+1][MAXPLAYERS+1];
ConVar wm_damageprint_auto_color;
ConVar wm_damageprint_auto_color;
ConVar wm_damageprint_enabled;
ConVar wm_damageprint_enabled;
ConVar wm_damageprint_format;
ConVar wm_damageprint_format;


/* Teams */
/* Teams */
bool team_switch = false;
bool team_switch = false;
ConVar wm_name_fix;
ConVar wm_name_fix;


/* BanOn Disconnect */
/* BanOn Disconnect */
bool g_disconnect[MAXPLAYERS + 1] = false;
bool g_disconnect[MAXPLAYERS + 1] = false;
ConVar wm_ban_on_disconnect;
ConVar wm_ban_on_disconnect;
ConVar wm_ban_percentage;
ConVar wm_ban_percentage;
ConVar sv_kick_ban_duration;
ConVar sv_kick_ban_duration;


/* Random Team Names and Logos */
/* Random Team Names and Logos */
static char g_teamName[][] = {"3DMAX", "Astana Dragons", "Bravado Gaming", "Cloud9", "Counter Logic Gaming", "Clan Mystik", "compLexity", "Copenhagen Wolves", "dAT Team", "Team Dignitas", "Epsilon eSports", "ESC Gaming", "Flipsid3 Tactics", "fnatic", "HellRaisers", "iBUYPOWER", "Team Wolf", "Keyd Stars", "London Conspiracy", "Team LDLC.com", "LGB eSports", "mousesports", "MyXMG", "Natus Vincere", "Ninjas in Pyjamas", "Team EnVyUs", "PENTA Sports", "Planetkey Dynamics", "Reason Gaming", "Team SoloMid", "Titan", "Vox Eminor", "VeryGames", "Virtus.Pro"};
static char g_teamName[][] = {"3DMAX", "Astana Dragons", "Bravado Gaming", "Cloud9", "Counter Logic Gaming", "Clan Mystik", "compLexity", "Copenhagen Wolves", "dAT Team", "Team Dignitas", "Epsilon eSports", "ESC Gaming", "Flipsid3 Tactics", "fnatic", "HellRaisers", "iBUYPOWER", "Team Wolf", "Keyd Stars", "London Conspiracy", "Team LDLC.com", "LGB eSports", "mousesports", "MyXMG", "Natus Vincere", "Ninjas in Pyjamas", "Team EnVyUs", "PENTA Sports", "Planetkey Dynamics", "Reason Gaming", "Team SoloMid", "Titan", "Vox Eminor", "VeryGames", "Virtus.Pro"};
static char g_teamTag[][] = {"3DMAX", "Astana Dragons", "Bravado", "Cloud9", "CLG", "Clan Mystik", "compLexity", "CPH Wolves", "dAT Team", "Dignitas", "Epsilon", "ESC", "Flipsid3", "fnatic", "HellRaisers", "iBUYPOWER", "Team Wolf", "Keyd Stars", "Ldn-Con", "Team LDLC", "LGB", "mousesports", "MyXMG", "Na`Vi", "NiP", "Team EnVyUs", "PENTA", "Planetkey", "Reason", "TSM", "Titan", "Vox Eminor", "VeryGames", "Virtus.Pro"};
static char g_teamTag[][] = {"3DMAX", "Astana Dragons", "Bravado", "Cloud9", "CLG", "Clan Mystik", "compLexity", "CPH Wolves", "dAT Team", "Dignitas", "Epsilon", "ESC", "Flipsid3", "fnatic", "HellRaisers", "iBUYPOWER", "Team Wolf", "Keyd Stars", "Ldn-Con", "Team LDLC", "LGB", "mousesports", "MyXMG", "Na`Vi", "NiP", "Team EnVyUs", "PENTA", "Planetkey", "Reason", "TSM", "Titan", "Vox Eminor", "VeryGames", "Virtus.Pro"};
static char g_teamLogo[][] = {"3dm", "ad", "bravg", "c9", "clg", "cm", "col", "cw", "dat", "dig", "eps", "esc", "flip", "fntc", "hlr", "ibp", "indw", "keyd", "lc", "ldlc", "lgb", "mss", "myxmg", "navi", "nip", "nv", "penta", "pkd", "rgg", "tsm", "tit", "ve", "vg", "vp"};
static char g_teamLogo[][] = {"3dm", "ad", "bravg", "c9", "clg", "cm", "col", "cw", "dat", "dig", "eps", "esc", "flip", "fntc", "hlr", "ibp", "indw", "keyd", "lc", "ldlc", "lgb", "mss", "myxmg", "navi", "nip", "nv", "penta", "pkd", "rgg", "tsm", "tit", "ve", "vg", "vp"};
int g_teamNumber_ct = 0;
int g_teamNumber_ct = 0;
int g_teamNumber_t = 0;
int g_teamNumber_t = 0;
bool g_tag_set = false;
bool g_tag_set = false;
ConVar wm_random_team_names;
ConVar wm_random_team_names;


bool g_first_load = true;
bool g_first_load = true;
int g_map_loaded = 0;
int g_map_loaded = 0;
/* admin menu */
/* admin menu */
Handle g_h_menu = INVALID_HANDLE;
Handle g_h_menu = INVALID_HANDLE;


/* Plugin info */
/* Plugin info */
#define UPDATE_URL "https://warmod.bitbucket.io/updatefile.txt"
#define UPDATE_URL "https://warmod.bitbucket.io/updatefile.txt"
#define WM_VERSION "18.05.24.0924"
#define WM_VERSION "18.05.24.0924"
#define WM_DESCRIPTION "An automative service for CS:GO competition matches"
#define WM_DESCRIPTION "An automative service for CS:GO competition matches"


public Plugin myinfo = {
public Plugin myinfo = {
name = "[BFG] WarMod",
name = "[BFG] WarMod",
author = "Versatile_BFG",
author = "Versatile_BFG",
description = WM_DESCRIPTION,
description = WM_DESCRIPTION,
version = WM_VERSION,
version = WM_VERSION,
url = "www.sourcemod.net"
url = "www.sourcemod.net"
};
};


public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
{
MarkNativeAsOptional("Zip_Open");
MarkNativeAsOptional("Zip_Open");
MarkNativeAsOptional("Zip_AddFile");
MarkNativeAsOptional("Zip_AddFile");
MarkNativeAsOptional("EasyFTP_UploadFile");
MarkNativeAsOptional("EasyFTP_UploadFile");
RegPluginLibrary("warmod");
RegPluginLibrary("warmod");
return APLRes_Success;
return APLRes_Success;
}
}


public void OnPluginStart()
public void OnPluginStart()
{
{
//auto update
//auto update
if (LibraryExists("updater"))
if (LibraryExists("updater"))
{
{
Updater_AddPlugin(UPDATE_URL);
Updater_AddPlugin(UPDATE_URL);
}
}
g_first_load = true;
g_first_load = true;
CheckConFigFiles(WM_VERSION);
CheckConFigFiles(WM_VERSION);
LoadTranslations("warmod.phrases");
LoadTranslations("warmod.phrases");
LoadTranslations("common.phrases");
LoadTranslations("common.phrases");
LoadTranslations("basebans.phrases");
LoadTranslations("basebans.phrases");
AutoExecConfig();
AutoExecConfig();
Handle topmenu;
Handle topmenu;
if (LibraryExists("adminmenu") && ((topmenu = GetAdminTopMenu()) != INVALID_HANDLE))
if (LibraryExists("adminmenu") && ((topmenu = GetAdminTopMenu()) != INVALID_HANDLE))
{
{
OnAdminMenuReady(topmenu);
OnAdminMenuReady(topmenu);
}
}
g_f_on_lo3 = CreateGlobalForward("OnLiveOn3", ET_Ignore);
g_f_on_lo3 = CreateGlobalForward("OnLiveOn3", ET_Ignore);
g_f_on_round_end = CreateGlobalForward("OnRoundEnd", ET_Ignore, Param_String, Param_Cell, Param_Cell, Param_String);
g_f_on_round_end = CreateGlobalForward("OnRoundEnd", ET_Ignore, Param_String, Param_Cell, Param_Cell, Param_String);
g_f_on_half_time = CreateGlobalForward("OnHalfTime", ET_Ignore, Param_String, Param_Cell, Param_Cell, Param_String);
g_f_on_half_time = CreateGlobalForward("OnHalfTime", ET_Ignore, Param_String, Param_Cell, Param_Cell, Param_String);
g_f_on_reset_half = CreateGlobalForward("OnResetHalf", ET_Ignore);
g_f_on_reset_half = CreateGlobalForward("OnResetHalf", ET_Ignore);
g_f_on_reset_match = CreateGlobalForward("OnResetMatch", ET_Ignore);
g_f_on_reset_match = CreateGlobalForward("OnResetMatch", ET_Ignore);
g_f_on_end_match = CreateGlobalForward("OnEndMatch", ET_Ignore, Param_String, Param_Cell, Param_Cell, Param_String);
g_f_on_end_match = CreateGlobalForward("OnEndMatch", ET_Ignore, Param_String, Param_Cell, Param_Cell, Param_String);
g_f_livewire_log_event = CreateGlobalForward("LiveWireLogEvent", ET_Ignore, Param_String);
g_f_livewire_log_event = CreateGlobalForward("LiveWireLogEvent", ET_Ignore, Param_String);
AddCommandListener(Command_JoinTeam, "jointeam");
AddCommandListener(Command_JoinTeam, "jointeam");
AddCommandListener(UnpauseMatch, "mp_unpause_match");
AddCommandListener(UnpauseMatch, "mp_unpause_match");
AddCommandListener(MatchRestore, "mp_backup_restore_load_file");
AddCommandListener(MatchRestore, "mp_backup_restore_load_file");
RegConsoleCmd("score", ConsoleScore);
RegConsoleCmd("score", ConsoleScore);
RegConsoleCmd("wm_version", WMVersion);
RegConsoleCmd("wm_version", WMVersion);
RegConsoleCmd("buy", RestrictBuy);
RegConsoleCmd("buy", RestrictBuy);
RegConsoleCmd("jointeam", ChooseTeam);
RegConsoleCmd("jointeam", ChooseTeam);
RegConsoleCmd("spectate", ChooseTeam);
RegConsoleCmd("spectate", ChooseTeam);
RegConsoleCmd("wm_readylist", ReadyList);
RegConsoleCmd("wm_readylist", ReadyList);
RegConsoleCmd("wmrl", ReadyList);
RegConsoleCmd("wmrl", ReadyList);
RegConsoleCmd("wm_cash", AskTeamMoney);
RegConsoleCmd("wm_cash", AskTeamMoney);
RegConsoleCmd("sm_name", SetName, "Sets the name for the team. Only active when wm_require_names 1 and at start of match");
RegConsoleCmd("sm_name", SetName, "Sets the name for the team. Only active when wm_require_names 1 and at start of match");
RegConsoleCmd("sm_logo", SetLogo, "Sets the logo and name for the team. Only active when wm_require_logos 1 and at start of match");
RegConsoleCmd("sm_logo", SetLogo, "Sets the logo and name for the team. Only active when wm_require_logos 1 and at start of match");
RegConsoleCmd("sm_ready", ReadyUp, "Readies up the client");
RegConsoleCmd("sm_ready", ReadyUp, "Readies up the client");
RegConsoleCmd("sm_r", ReadyUp, "Readies up the client");
RegConsoleCmd("sm_r", ReadyUp, "Readies up the client");
RegConsoleCmd("sm_rdy", ReadyUp, "Readies up the client");
RegConsoleCmd("sm_rdy", ReadyUp, "Readies up the client");
RegConsoleCmd("sm_unready", ReadyDown, "Readies down the client");
RegConsoleCmd("sm_unready", ReadyDown, "Readies down the client");
RegConsoleCmd("sm_ur", ReadyDown, "Readies down the client");
RegConsoleCmd("sm_ur", ReadyDown, "Readies down the client");
RegConsoleCmd("sm_urdy", ReadyDown, "Readies down the client");
RegConsoleCmd("sm_urdy", ReadyDown, "Readies down the client");
RegConsoleCmd("sm_info", ReadyInfoPriv, "Shows ready info");
RegConsoleCmd("sm_info", ReadyInfoPriv, "Shows ready info");
RegConsoleCmd("sm_i", ReadyInfoPriv, "Shows ready info");
RegConsoleCmd("sm_i", ReadyInfoPriv, "Shows ready info");
RegConsoleCmd("sm_score", ShowScore, "Shows score to client");
RegConsoleCmd("sm_score", ShowScore, "Shows score to client");
RegConsoleCmd("sm_s", ShowScore, "Shows score to client");
RegConsoleCmd("sm_s", ShowScore, "Shows score to client");
RegConsoleCmd("sm_stay", Stay, "Stay command for knife round");
RegConsoleCmd("sm_stay", Stay, "Stay command for knife round");
RegConsoleCmd("sm_switch", Switch, "Switch command for knife round");
RegConsoleCmd("sm_switch", Switch, "Switch command for knife round");
RegConsoleCmd("sm_swap", Switch, "Switch command for knife round");
RegConsoleCmd("sm_swap", Switch, "Switch command for knife round");
RegConsoleCmd("sm_pause", Pause, "Pauses the match");
RegConsoleCmd("sm_pause", Pause, "Pauses the match");
RegConsoleCmd("sm_unpause", Unpause, "Resumes the match");
RegConsoleCmd("sm_unpause", Unpause, "Resumes the match");
RegConsoleCmd("sm_playout", PlayOut_Offer, "Sets the match to be in play out mode");
RegConsoleCmd("sm_playout", PlayOut_Offer, "Sets the match to be in play out mode");
RegConsoleCmd("sm_pl", PlayOut_Offer, "Sets the match to be in play out mode");
RegConsoleCmd("sm_pl", PlayOut_Offer, "Sets the match to be in play out mode");
RegConsoleCmd("sm_hardprac", PlayOut_Offer, "Sets the match to be in play out mode");
RegConsoleCmd("sm_hardprac", PlayOut_Offer, "Sets the match to be in play out mode");
RegConsoleCmd("sm_hp", PlayOut_Offer, "Sets the match to be in play out mode");
RegConsoleCmd("sm_hp", PlayOut_Offer, "Sets the match to be in play out mode");
RegConsoleCmd("sm_overtime", OverTime_Offer, "Sets the match to be in overtime mode");
RegConsoleCmd("sm_overtime", OverTime_Offer, "Sets the match to be in overtime mode");
RegConsoleCmd("sm_ot", OverTime_Offer, "Sets the match to be in overtime mode");
RegConsoleCmd("sm_ot", OverTime_Offer, "Sets the match to be in overtime mode");
RegConsoleCmd("sm_normal", Default_Offer, "Sets the match to be in default mode");
RegConsoleCmd("sm_normal", Default_Offer, "Sets the match to be in default mode");
RegConsoleCmd("sm_norm", Default_Offer, "Sets the match to be in default mode");
RegConsoleCmd("sm_norm", Default_Offer, "Sets the match to be in default mode");
RegConsoleCmd("sm_default", Default_Offer, "Sets the match to be in default mode");
RegConsoleCmd("sm_default", Default_Offer, "Sets the match to be in default mode");
RegConsoleCmd("sm_def", Default_Offer, "Sets the match to be in default mode");
RegConsoleCmd("sm_def", Default_Offer, "Sets the match to be in default mode");
/* Veto cmds */
/* Veto cmds */
RegConsoleCmd("sm_vetobo1", Veto_Bo1, "Ask for a Bo1 Veto");
RegConsoleCmd("sm_vetobo1", Veto_Bo1, "Ask for a Bo1 Veto");
RegConsoleCmd("sm_vetobo2", Veto_Bo2, "Ask for a Bo2 Veto");
RegConsoleCmd("sm_vetobo2", Veto_Bo2, "Ask for a Bo2 Veto");
RegConsoleCmd("sm_vetobo3", Veto_Bo3, "Ask for a Bo3 Veto");
RegConsoleCmd("sm_vetobo3", Veto_Bo3, "Ask for a Bo3 Veto");
RegConsoleCmd("sm_vetobo5", Veto_Bo5, "Ask for a Bo5 Veto");
RegConsoleCmd("sm_vetobo5", Veto_Bo5, "Ask for a Bo5 Veto");
RegConsoleCmd("sm_veto", Veto_Setup, "Ask for Veto");
RegConsoleCmd("sm_veto", Veto_Setup, "Ask for Veto");
RegConsoleCmd("sm_veto1", Veto_Bo1, "Ask for a Bo1 Veto");
RegConsoleCmd("sm_veto1", Veto_Bo1, "Ask for a Bo1 Veto");
RegConsoleCmd("sm_veto2", Veto_Bo2, "Ask for a Bo2 Veto");
RegConsoleCmd("sm_veto2", Veto_Bo2, "Ask for a Bo2 Veto");
RegConsoleCmd("sm_veto3", Veto_Bo3, "Ask for a Bo3 Veto");
RegConsoleCmd("sm_veto3", Veto_Bo3, "Ask for a Bo3 Veto");
RegConsoleCmd("sm_veto5", Veto_Bo5, "Ask for a Bo5 Veto");
RegConsoleCmd("sm_veto5", Veto_Bo5, "Ask for a Bo5 Veto");
RegConsoleCmd("sm_vetomaps", Veto_Bo3_Maps, "Veto Bo3 Maps");
RegConsoleCmd("sm_vetomaps", Veto_Bo3_Maps, "Veto Bo3 Maps");
/* admin commands */
/* admin commands */
RegAdminCmd("notlive", NotLive, ADMFLAG_CUSTOM1, "Declares half not live and restarts the round");
RegAdminCmd("notlive", NotLive, ADMFLAG_CUSTOM1, "Declares half not live and restarts the round");
RegAdminCmd("nl", NotLive, ADMFLAG_CUSTOM1, "Declares half not live and restarts the round");
RegAdminCmd("nl", NotLive, ADMFLAG_CUSTOM1, "Declares half not live and restarts the round");
RegAdminCmd("cancelhalf", NotLive, ADMFLAG_CUSTOM1, "Declares half not live and restarts the round");
RegAdminCmd("cancelhalf", NotLive, ADMFLAG_CUSTOM1, "Declares half not live and restarts the round");
RegAdminCmd("ch", NotLive, ADMFLAG_CUSTOM1, "Declares half not live and restarts the round");
RegAdminCmd("ch", NotLive, ADMFLAG_CUSTOM1, "Declares half not live and restarts the round");
RegAdminCmd("cancelmatch", CancelMatch, ADMFLAG_CUSTOM1, "Declares match not live and restarts round");
RegAdminCmd("cancelmatch", CancelMatch, ADMFLAG_CUSTOM1, "Declares match not live and restarts round");
RegAdminCmd("cm", CancelMatch, ADMFLAG_CUSTOM1, "Declares match not live and restarts round");
RegAdminCmd("cm", CancelMatch, ADMFLAG_CUSTOM1, "Declares match not live and restarts round");
RegAdminCmd("readyup", ReadyToggle, ADMFLAG_CUSTOM1, "Starts or stops the ReadyUp System");
RegAdminCmd("readyup", ReadyToggle, ADMFLAG_CUSTOM1, "Starts or stops the ReadyUp System");
RegAdminCmd("ru", ReadyToggle, ADMFLAG_CUSTOM1, "Starts or stops the ReadyUp System");
RegAdminCmd("ru", ReadyToggle, ADMFLAG_CUSTOM1, "Starts or stops the ReadyUp System");
RegAdminCmd("t", ChangeT, ADMFLAG_CUSTOM1, "Team starting terrorists - Designed for score purposes");
RegAdminCmd("t", ChangeT, ADMFLAG_CUSTOM1, "Team starting terrorists - Designed for score purposes");
RegAdminCmd("ct", ChangeCT, ADMFLAG_CUSTOM1, "Team starting counter-terrorists - Designed for score purposes");
RegAdminCmd("ct", ChangeCT, ADMFLAG_CUSTOM1, "Team starting counter-terrorists - Designed for score purposes");
RegAdminCmd("sst", SetScoreT, ADMFLAG_CUSTOM1, "Setting terrorists score");
RegAdminCmd("sst", SetScoreT, ADMFLAG_CUSTOM1, "Setting terrorists score");
RegAdminCmd("ssct", SetScoreCT, ADMFLAG_CUSTOM1, "Setting counter-terrorists scores");
RegAdminCmd("ssct", SetScoreCT, ADMFLAG_CUSTOM1, "Setting counter-terrorists scores");
RegAdminCmd("aswap", SwapAll, ADMFLAG_CUSTOM1, "Swap all players to the opposite team");
RegAdminCmd("aswap", SwapAll, ADMFLAG_CUSTOM1, "Swap all players to the opposite team");
RegAdminCmd("prac", Practice, ADMFLAG_CUSTOM1, "Puts server into a practice mode state");
RegAdminCmd("prac", Practice, ADMFLAG_CUSTOM1, "Puts server into a practice mode state");
RegAdminCmd("warmup", WarmUp, ADMFLAG_CUSTOM1, "Puts server into a warm up state");
RegAdminCmd("warmup", WarmUp, ADMFLAG_CUSTOM1, "Puts server into a warm up state");
RegAdminCmd("pwd", ChangePassword, ADMFLAG_PASSWORD, "Set or display the sv_password console variable");
RegAdminCmd("pwd", ChangePassword, ADMFLAG_PASSWORD, "Set or display the sv_password console variable");
RegAdminCmd("pw", ChangePassword, ADMFLAG_PASSWORD, "Set or display the sv_password console variable");
RegAdminCmd("pw", ChangePassword, ADMFLAG_PASSWORD, "Set or display the sv_password console variable");
RegAdminCmd("active", ActiveToggle, ADMFLAG_CUSTOM1, "Toggle the wm_active console variable");
RegAdminCmd("active", ActiveToggle, ADMFLAG_CUSTOM1, "Toggle the wm_active console variable");
RegAdminCmd("minready", ChangeMinReady, ADMFLAG_CUSTOM1, "Set or display the wm_min_ready console variable");
RegAdminCmd("minready", ChangeMinReady, ADMFLAG_CUSTOM1, "Set or display the wm_min_ready console variable");
RegAdminCmd("maxrounds", ChangeMaxRounds, ADMFLAG_CUSTOM1, "Set or display the wm_max_rounds console variable");
RegAdminCmd("maxrounds", ChangeMaxRounds, ADMFLAG_CUSTOM1, "Set or display the wm_max_rounds console variable");
RegAdminCmd("knife", KnifeOn3, ADMFLAG_CUSTOM1, "Remove all weapons except knife and lo3");
RegAdminCmd("knife", KnifeOn3, ADMFLAG_CUSTOM1, "Remove all weapons except knife and lo3");
RegAdminCmd("ko3", KnifeOn3, ADMFLAG_CUSTOM1, "Remove all weapons except knife and lo3");
RegAdminCmd("ko3", KnifeOn3, ADMFLAG_CUSTOM1, "Remove all weapons except knife and lo3");
RegAdminCmd("cancelknife", CancelKnife, ADMFLAG_CUSTOM1, "Declares knife not live and restarts round");
RegAdminCmd("cancelknife", CancelKnife, ADMFLAG_CUSTOM1, "Declares knife not live and restarts round");
RegAdminCmd("ck", CancelKnife, ADMFLAG_CUSTOM1, "Declares knife not live and restarts round");
RegAdminCmd("ck", CancelKnife, ADMFLAG_CUSTOM1, "Declares knife not live and restarts round");
RegAdminCmd("forceallready", ForceAllReady, ADMFLAG_CUSTOM1, "Forces all players to become ready");
RegAdminCmd("forceallready", ForceAllReady, ADMFLAG_CUSTOM1, "Forces all players to become ready");
RegAdminCmd("far", ForceAllReady, ADMFLAG_CUSTOM1, "Forces all players to become ready");
RegAdminCmd("far", ForceAllReady, ADMFLAG_CUSTOM1, "Forces all players to become ready");
RegAdminCmd("forceallunready", ForceAllUnready, ADMFLAG_CUSTOM1, "Forces all players to become unready");
RegAdminCmd("forceallunready", ForceAllUnready, ADMFLAG_CUSTOM1, "Forces all players to become unready");
RegAdminCmd("faur", ForceAllUnready, ADMFLAG_CUSTOM1, "Forces all players to become unready");
RegAdminCmd("faur", ForceAllUnready, ADMFLAG_CUSTOM1, "Forces all players to become unready");
RegAdminCmd("forceallspectate", ForceAllSpectate, ADMFLAG_CUSTOM1, "Forces all players to become a spectator");
RegAdminCmd("forceallspectate", ForceAllSpectate, ADMFLAG_CUSTOM1, "Forces all players to become a spectator");
RegAdminCmd("fas", ForceAllSpectate, ADMFLAG_CUSTOM1, "Forces all players to become a spectator");
RegAdminCmd("fas", ForceAllSpectate, ADMFLAG_CUSTOM1, "Forces all players to become a spectator");
RegAdminCmd("lo3", ForceStart, ADMFLAG_CUSTOM1, "Starts the match regardless of player and ready count");
RegAdminCmd("lo3", ForceStart, ADMFLAG_CUSTOM1, "Starts the match regardless of player and ready count");
RegAdminCmd("forcestart", ForceStart, ADMFLAG_CUSTOM1, "Starts the match regardless of player and ready count");
RegAdminCmd("forcestart", ForceStart, ADMFLAG_CUSTOM1, "Starts the match regardless of player and ready count");
RegAdminCmd("fs", ForceStart, ADMFLAG_CUSTOM1, "Starts the match regardless of player and ready count");
RegAdminCmd("fs", ForceStart, ADMFLAG_CUSTOM1, "Starts the match regardless of player and ready count");
RegAdminCmd("forceend", ForceEnd, ADMFLAG_CUSTOM1, "Ends the match regardless of status");
RegAdminCmd("forceend", ForceEnd, ADMFLAG_CUSTOM1, "Ends the match regardless of status");
RegAdminCmd("fe", ForceEnd, ADMFLAG_CUSTOM1, "Ends the match regardless of status");
RegAdminCmd("fe", ForceEnd, ADMFLAG_CUSTOM1, "Ends the match regardless of status");
RegAdminCmd("readyon", ReadyOn, ADMFLAG_CUSTOM1, "Turns on or restarts the ReadyUp System");
RegAdminCmd("readyon", ReadyOn, ADMFLAG_CUSTOM1, "Turns on or restarts the ReadyUp System");
RegAdminCmd("ron", ReadyOn, ADMFLAG_CUSTOM1, "Turns on or restarts the ReadyUp System");
RegAdminCmd("ron", ReadyOn, ADMFLAG_CUSTOM1, "Turns on or restarts the ReadyUp System");
RegAdminCmd("readyoff", ReadyOff, ADMFLAG_CUSTOM1, "Turns off the ReadyUp System if enabled");
RegAdminCmd("readyoff", ReadyOff, ADMFLAG_CUSTOM1, "Turns off the ReadyUp System if enabled");
RegAdminCmd("roff", ReadyOff, ADMFLAG_CUSTOM1, "Turns off the ReadyUp System if enabled");
RegAdminCmd("roff", ReadyOff, ADMFLAG_CUSTOM1, "Turns off the ReadyUp System if enabled");
RegAdminCmd("updatecfgs", UpdateCFGs, ADMFLAG_CUSTOM1, "Updates configs with the latest format");
RegAdminCmd("updatecfgs", UpdateCFGs, ADMFLAG_CUSTOM1, "Updates configs with the latest format");
// server commands
// server commands
RegServerCmd("wm_status", WarMod_Status);
RegServerCmd("wm_status", WarMod_Status);
RegServerCmd("wm_forceteam", ForceTeam, "Force the SteamID64 client to a team");
RegServerCmd("wm_forceteam", ForceTeam, "Force the SteamID64 client to a team");
RegServerCmd("wm_clear_forceteam_all", ClearForceTeamAll, "Clears the list for forced teams");
RegServerCmd("wm_clear_forceteam_all", ClearForceTeamAll, "Clears the list for forced teams");
RegServerCmd("wm_clear_forceteam_t", ClearForceTeamT, "Clears the list for forced terrorist team");
RegServerCmd("wm_clear_forceteam_t", ClearForceTeamT, "Clears the list for forced terrorist team");
RegServerCmd("wm_clear_forceteam_ct", ClearForceTeamCT, "Clears the list for forced counter-terrorist team");
RegServerCmd("wm_clear_forceteam_ct", ClearForceTeamCT, "Clears the list for forced counter-terrorist team");
RegServerCmd("wm_forcename", ForceClientName, "Force the SteamID64 client's name");
RegServerCmd("wm_forcename", ForceClientName, "Force the SteamID64 client's name");
/* Warmod Convars */
/* Warmod Convars */
wm_active = CreateConVar("wm_active", "1", "Enable or disable WarMod as active", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_active = CreateConVar("wm_active", "1", "Enable or disable WarMod as active", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_warmod_safemode = CreateConVar("wm_warmod_safemode", "0", "This disables features that usually break on a CS:GO update", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_warmod_safemode = CreateConVar("wm_warmod_safemode", "0", "This disables features that usually break on a CS:GO update", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_rcon_only = CreateConVar("wm_rcon_only", "0", "Enable or disable admin commands to be only executed via RCON or console", FCVAR_NONE, true, 0.0, true, 1.0);
wm_rcon_only = CreateConVar("wm_rcon_only", "0", "Enable or disable admin commands to be only executed via RCON or console", FCVAR_NONE, true, 0.0, true, 1.0);
CreateConVar("wm_version_notify", WM_VERSION, WM_DESCRIPTION, FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
CreateConVar("wm_version_notify", WM_VERSION, WM_DESCRIPTION, FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
wm_chat_prefix = CreateConVar("wm_chat_prefix", "WarMod_BFG", "Change the chat prefix. Default is WarMod_BFG", FCVAR_PROTECTED);
wm_chat_prefix = CreateConVar("wm_chat_prefix", "GGA [LAN]", "Change the chat prefix. Default is GGA_LAN", FCVAR_PROTECTED);
wm_ready_panel = CreateConVar("wm_ready_panel", "1", "Enable Ready Panel or text based system, Text = 0, Panel = 1", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_ready_panel = CreateConVar("wm_ready_panel", "1", "Enable Ready Panel or text based system, Text = 0, Panel = 1", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_ready_tag = CreateConVar("wm_ready_tag", "1", "Enable or disable the ready & not ready clan tags", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_ready_tag = CreateConVar("wm_ready_tag", "1", "Enable or disable the ready & not ready clan tags", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_lock_teams = CreateConVar("wm_lock_teams", "1", "Enable or disable locked teams when a match is running", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_lock_teams = CreateConVar("wm_lock_teams", "1", "Enable or disable locked teams when a match is running", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_min_ready = CreateConVar("wm_min_ready", "10", "Sets the minimum required ready players to Live on 3", FCVAR_NOTIFY);
wm_min_ready = CreateConVar("wm_min_ready", "10", "Sets the minimum required ready players to Live on 3", FCVAR_NOTIFY);
wm_max_players = CreateConVar("wm_max_players", "10", "Sets the maximum players allowed on both teams combined, others will be forced to spectator (0 = unlimited)", FCVAR_NOTIFY, true, 0.0);
wm_max_players = CreateConVar("wm_max_players", "10", "Sets the maximum players allowed on both teams combined, others will be forced to spectator (0 = unlimited)", FCVAR_NOTIFY, true, 0.0);
wm_half_time_break = CreateConVar("wm_half_time_break", "0", "Pause game at halftime for a break, No break = 0, break = 1", FCVAR_NONE, true, 0.0, true, 1.0);
wm_half_time_break = CreateConVar("wm_half_time_break", "0", "Pause game at halftime for a break, No break = 0, break = 1", FCVAR_NONE, true, 0.0, true, 1.0);
wm_over_time_break = CreateConVar("wm_over_time_break", "0", "Pause game at overtime for a break, No break = 0, break = 1", FCVAR_NONE, true, 0.0, true, 1.0);
wm_over_time_break = CreateConVar("wm_over_time_break", "0", "Pause game at overtime for a break, No break = 0, break = 1", FCVAR_NONE, true, 0.0, true, 1.0);
wm_round_money = CreateConVar("wm_round_money", "1", "Enable or disable a client's team mates money to be displayed at the start of a round (to him only)", FCVAR_NONE, true, 0.0, true, 1.0);
wm_round_money = CreateConVar("wm_round_money", "1", "Enable or disable a client's team mates money to be displayed at the start of a round (to him only)", FCVAR_NONE, true, 0.0, true, 1.0);
wm_ingame_scores = CreateConVar("wm_ingame_scores", "1", "Enable or disable ingame scores to be showed at the end of each round", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_ingame_scores = CreateConVar("wm_ingame_scores", "1", "Enable or disable ingame scores to be showed at the end of each round", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_require_names = CreateConVar("wm_require_names", "0", "Enable or disable the requirement of set team names for lo3", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_require_names = CreateConVar("wm_require_names", "0", "Enable or disable the requirement of set team names for lo3", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_require_logos = CreateConVar("wm_require_logos", "0", "Enable or disable the requirement of set team logos for lo3", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_require_logos = CreateConVar("wm_require_logos", "0", "Enable or disable the requirement of set team logos for lo3", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_logos_menu_only = CreateConVar("wm_logos_menu_only", "0", "Set to use the Menu only for Logo Selection", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_logos_menu_only = CreateConVar("wm_logos_menu_only", "0", "Set to use the Menu only for Logo Selection", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_random_team_names = CreateConVar("wm_random_team_names", "0", "Enable or disable the random set of a pro team name for the match", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_random_team_names = CreateConVar("wm_random_team_names", "0", "Enable or disable the random set of a pro team name for the match", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_show_info = CreateConVar("wm_show_info", "1", "Enable or disable the display of the Ready System to players", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_show_info = CreateConVar("wm_show_info", "1", "Enable or disable the display of the Ready System to players", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_auto_ready = CreateConVar("wm_auto_ready", "1", "Enable or disable the ready system being automatically enabled on map change", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_auto_ready = CreateConVar("wm_auto_ready", "1", "Enable or disable the ready system being automatically enabled on map change", FCVAR_NOTIFY, true, 0.0, true, 1.0);
/* Ban Convars */
/* Ban Convars */
wm_ban_on_disconnect = CreateConVar("wm_ban_on_disconnect", "0", "Enable or disable players banned on disconnect if match is live", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_ban_on_disconnect = CreateConVar("wm_ban_on_disconnect", "0", "Enable or disable players banned on disconnect if match is live", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_ban_percentage = CreateConVar("wm_ban_percentage", "0.75", "Percentage of wm_max_players that will be banned on disconnect", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_ban_percentage = CreateConVar("wm_ban_percentage", "0.75", "Percentage of wm_max_players that will be banned on disconnect", FCVAR_NOTIFY, true, 0.0, true, 1.0);
sv_kick_ban_duration = FindConVar("sv_kick_ban_duration");
sv_kick_ban_duration = FindConVar("sv_kick_ban_duration");
/* Stats & Demo Convars */
/* Stats & Demo Convars */
tv_enable = FindConVar("tv_enable");
tv_enable = FindConVar("tv_enable");
wm_stats_enabled = CreateConVar("wm_stats_enabled", "1", "Enable or disable statistical logging", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_stats_enabled = CreateConVar("wm_stats_enabled", "1", "Enable or disable statistical logging", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_stats_method = CreateConVar("wm_stats_method", "2", "Sets the stats logging method: 0 = UDP stream/server logs, 1 = WarMod logs, 2 = both", FCVAR_NOTIFY, true, 0.0, true, 2.0);
wm_stats_method = CreateConVar("wm_stats_method", "2", "Sets the stats logging method: 0 = UDP stream/server logs, 1 = WarMod logs, 2 = both", FCVAR_NOTIFY, true, 0.0, true, 2.0);
wm_stats_trace = CreateConVar("wm_stats_trace", "0", "Enable or disable updating all player positions, every wm_stats_trace_delay seconds", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_stats_trace = CreateConVar("wm_stats_trace", "0", "Enable or disable updating all player positions, every wm_stats_trace_delay seconds", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_stats_trace_delay = CreateConVar("wm_stats_trace_delay", "5", "The amount of time between sending player position updates", FCVAR_NOTIFY, true, 0.0);
wm_stats_trace_delay = CreateConVar("wm_stats_trace_delay", "5", "The amount of time between sending player position updates", FCVAR_NOTIFY, true, 0.0);
wm_auto_record = CreateConVar("wm_auto_record", "1", "Enable or disable auto SourceTV demo record on Live on 3", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_auto_record = CreateConVar("wm_auto_record", "1", "Enable or disable auto SourceTV demo record on Live on 3", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_save_dir = CreateConVar("wm_save_dir", "warmod", "Directory to store SourceTV demos and WarMod logs");
wm_save_dir = CreateConVar("wm_save_dir", "warmod", "Directory to store SourceTV demos and WarMod logs");
wm_prefix_logs = CreateConVar("wm_prefix_logs", "1", "Enable or disable the prefixing of \"_\" to uncompleted match SourceTV demos and WarMod logs", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_prefix_logs = CreateConVar("wm_prefix_logs", "1", "Enable or disable the prefixing of \"_\" to uncompleted match SourceTV demos and GGA logs", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_competition = CreateConVar("wm_competition", "WarMod BFG", "Name of host for a competition. eg. ESEA, Cybergamer, CEVO, ESL");
wm_competition = CreateConVar("wm_competition", "WarMod BFG", "Name of host for a competition. eg. ESEA, Cybergamer, CEVO, ESL");
wm_event = CreateConVar("wm_event", "scrim", "Name of event. eg. Season #, ODC #, Ladder");
wm_event = CreateConVar("wm_event", "scrim", "Name of event. eg. Season #, ODC #, Ladder");
/* SQL Settings */
/* SQL Settings */
wm_upload_results = CreateConVar("wm_upload_results", "0", "Enable or disable the uploading of match results via MySQL", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_upload_results = CreateConVar("wm_upload_results", "0", "Enable or disable the uploading of match results via MySQL", FCVAR_NOTIFY, true, 0.0, true, 1.0);
wm_table_name = CreateConVar("wm_table_name", "wm_results", "The MySQL table name to store match results in");
wm_table_name = CreateConVar("wm_table_name", "wm_results", "The MySQL table name to store match results in");
//wm_table_name_players = CreateConVar("wm_table_name_players", "wm_players", "The MySQL table name to store match players in");
//wm_table_name_players = CreateConVar("wm_table_name_players", "wm_players", "The MySQL table name to store match players in");
wm_table_round_stats = CreateConVar("wm_table_round_stats", "wm_round_stats", "The MySQL table name to store round stats in");
wm_table_round_stats = CreateConVar("wm_table_round_stats", "wm_round_stats", "The MySQL table name to store round stats in");
/* Config Convars */
/* Config Convars */
wm_match_config = CreateConVar("wm_match_config", "warmod/ruleset_default.cfg", "Sets the match config to load on Live on 3");
wm_match_config = CreateConVar("wm_match_config", "warmod/ruleset_default.cfg", "Sets the match config to load on Live on 3");
wm_reset_config = CreateConVar("wm_reset_config", "warmod/on_match_end.cfg", "Sets the config to load at the end/reset of a match");
wm_reset_config = CreateConVar("wm_reset_config", "warmod/on_match_end.cfg", "Sets the config to load at the end/reset of a match");
wm_reset_config_delay = CreateConVar("wm_reset_config_delay", "1", "The amount of time before executing the reset config after a match", FCVAR_N
wm_reset_config_delay = CreateConVar("wm_reset_config_delay", "1", "The amount of time before executing the reset config after a match", FCVAR_NOTIFY,