#include #include #include public Plugin myinfo = { name = "yuuko's map timer commands", author = "yuuko", description = "exposes the map-related bits of to the console", version = SOURCEMOD_VERSION, url = "https://www.partyvan.io/" }; public Action Command_ExtendMapTimeLimit(int client, int args) { if (args != 1) { PrintToConsole(client, "Usage: sm_extendmaptimelimit "); return Plugin_Handled; } int seconds = 0; if (!GetCmdArgIntEx(1, seconds)) { PrintToConsole(client, "argument must be an integer"); return Plugin_Handled; } if (!ExtendMapTimeLimit(seconds)) { PrintToConsole(client, "operation not supported"); return Plugin_Handled; } PrintToConsole(client, "map time limit extended"); return Plugin_Handled; } public Action Command_GetMapTimeLimit(int client, int args) { if (args != 0) { PrintToConsole(client, "Usage: sm_getmaptimelimit"); return Plugin_Handled; } int minutes = 0; if (!GetMapTimeLimit(minutes)) { PrintToConsole(client, "operation not supported"); return Plugin_Handled; } PrintToConsole(client, "%d", minutes); return Plugin_Handled; } public Action Command_GetMapTimeLeft(int client, int args) { if (args != 0) { PrintToConsole(client, "Usage: sm_getmaptimeleft"); return Plugin_Handled; } int seconds = 0; if (!GetMapTimeLeft(seconds)) { PrintToConsole(client, "operation not supported"); return Plugin_Handled; } PrintToConsole(client, "%d", seconds); return Plugin_Handled; } public void OnPluginStart() { RegAdminCmd( "sm_extendmaptimelimit", Command_ExtendMapTimeLimit, ADMFLAG_CHANGEMAP, "extend map time limit by argv[1] seconds" ); RegConsoleCmd( "sm_getmaptimelimit", Command_GetMapTimeLimit, "get map time limit, in minutes for some reason (api docs are a lie)" ); RegConsoleCmd( "sm_getmaptimeleft", Command_GetMapTimeLeft, "get (approximate) time left out of map time limit, in seconds" ); }