#define VERSION "GRAPEFRUITS" #pragma semicolon 1 #include public Plugin:myinfo = { name = "Useful Stuff", author = "WakiMiko", description = "Adds some stuff", version = VERSION, url = "http://wakimiko.wwwchan.com/" }; new Handle:g_Cvar_Timelimit = INVALID_HANDLE; public OnPluginStart() { LoadTranslations("common.phrases"); //Map Time g_Cvar_Timelimit = FindConVar("mp_timelimit"); RegAdminCmd("sm_addmaptime", Command_AddMapTime, ADMFLAG_CHANGEMAP, "Extends the current map. Usage: sm_addmaptime "); RegAdminCmd("sm_setmaptime", Command_SetMapTime, ADMFLAG_CHANGEMAP, "Sets the timelimit for the current map. Usage: sm_setmaptime "); //MotD RegAdminCmd("sm_showmotd", Command_Motd, ADMFLAG_GENERIC, "Shows the MOTD to the specified client. Usage: sm_showmotd "); } public Action:Command_AddMapTime(client, args) { if(args == 1) { decl String:arg[16]; GetCmdArg(1, arg, sizeof(arg)); new time = StringToInt(arg); ExtendMapTimeLimit(time * 60); } else ReplyToCommand(client, "[SM] Usage: sm_addmaptime "); return Plugin_Handled; } public Action:Command_SetMapTime(client, args) { if(args == 1) { decl String:arg[16]; GetCmdArg(1, arg, sizeof(arg)); new time = StringToInt(arg); new timeleft; new timelimit; GetMapTimeLimit(timelimit); GetMapTimeLeft(timeleft); timeleft /= 60; SetConVarInt(g_Cvar_Timelimit, timelimit + time - timeleft); } else ReplyToCommand(client, "[SM] Usage: sm_setmaptime "); return Plugin_Handled; } public Action:Command_Motd(client, args){ if(args == 1) { decl String:arg1[35]; GetCmdArg(1, arg1, sizeof(arg1)); new target = FindTarget(0, arg1, true, false); if (target == -1) return Plugin_Handled; ShowMotd(target); } else ReplyToCommand(client, "[SM] Usage: sm_showmotd "); return Plugin_Handled; } public ShowMotd(target) { ShowMOTDPanel(target,"Message Of The Day","motd",MOTDPANEL_TYPE_INDEX); }