PHP Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo =
{
name = "Tez's Warmup",
author = "Tez",
description = "starting the warmup within a command.",
version = "1.0",
url = "https://www.sourcemod.net/"
};
public void OnPluginStart()
{
RegAdminCmd("sm_wms", Command_WMS, ADMFLAG_GENERIC, "Warmup will start in 1 second.");
RegAdminCmd("sm_wme", Command_WME, ADMFLAG_GENERIC, "Warmup will end in 1 second.");
}
public Action Command_WMS(int client, int args)
{
CreateTimer(1.0, WarmupStart);
PrintToChatAll(" \x04[SM]\x01 Warmup will start in 1 second.");
return Plugin_Handled;
}
public Action Command_WME(int client, int args)
{
CreateTimer(1.0, WarmupEnd);
PrintToChatAll(" \x04[SM]\x01 Warmup will end in 1 second!");
return Plugin_Handled;
}
public Action WarmupStart(Handle timer)
{
ServerCommand("mp_warmup_start");
}
public Action WarmupEnd(Handle timer)
{
ServerCommand("mp_warmup_end");
}
This is just an example of how you could do it. Since the cvar´s "mp_round_start" and "mp_round_end" have no values, you can just use the function ServerCommand for it.
And next time, please use the [PHP] Tag to make the code more readable for us..