Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DevRuto committed Apr 3, 2018
0 parents commit a9e8d4a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# SMSimpleExtendTime
47 changes: 47 additions & 0 deletions simpleextendtime.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#pragma newdecls required
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

#define PLUGIN_AUTHOR "Ruto"
#define PLUGIN_VERSION "0.01"

public Plugin myinfo =
{
name = "Ruto's Simple Extend Time",
author = PLUGIN_AUTHOR,
description = "Simple Time Extender for admins",
version = PLUGIN_VERSION,
url = "https://github.com/RutoTV/SMSimpleExtendTime"
};

ConVar g_timelimit;

public void OnPluginStart()
{
RegAdminCmd("sm_extendtime", Command_ExtendTime, ADMFLAG_GENERIC, "Extends the timelimit of the map");
g_timelimit = FindConVar("mp_timelimit");
}

public Action Command_ExtendTime(int client, int args)
{
if (args < 1)
{
PrintToConsole(client, "Usage: sm_extendtime <length,max:9999> or sm_extendtime 0 for infinite until RTV");
return Plugin_Handled;
}

char sarg[6];
GetCmdArg(1, sarg, sizeof(sarg));
int length = 0;
if ((length = StringToInt(sarg)) == 0)
{
PrintToConsole(client, "Usage: sm_extendtime <length,max:9999> or sm_extendtime 0 for infinity until RTV");
return Plugin_Handled;
}

g_timelimit.SetInt(length, false, true);

return Plugin_Handled;
}

0 comments on commit a9e8d4a

Please sign in to comment.