I'm new to this sourcemod/sourcepawn/C++ coding, and i'm trying to make a "simple" plugin that lets admins extend the map time by x amount, simply by typing !extend x in the game chat.
I'm continuously getting errors, which I seem to fix, yet when I run the command nothing happens in game (it recognizes it as a command, but wont do anything)
Currently I have this:
Code:
public void OnPluginStart()
{
RegAdminCmd("sm_extend", Command_Extend, ADMFLAG_KICK, "Extends the map by a given time");
}
public Action Command_Extend(int client, int args)
{
if (args < 1 || args > 1)
{
PrintToConsole(client, "Usage: sm_extend <time to extend map by>");
PrintToChat(client, "Usage: sm_extend <time to extend map by>");
return Plugin_Handled;
}
char arg1[32];
new timeLimit;
new arg2;
new timeLimitCvar;
timeLimitCvar = GetConVarInt("mp_timelimit");
arg2 = GetCmdArg(1, arg1, sizeof(arg1));
timeLimit = timeLimitCvar + arg2;
ServerCommand("mp_timelimit %s", timeLimit)
return Plugin_Handled;
}
Im currently getting error 35 on line 32 (timeLimitCvar = GetConVarInt("mp_timelimit");)
Does anyone know what i'm doing wrong? Like I said im new to this stuff, but id like to think its something simple