oh, sorry my friend!
please test this cod:
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
ConVar Cvar_Enable;
ConVar Cvar_MapName;
ConVar Cvar_Time;
int Int_iTimer = 0;
public Plugin myinfo =
{
name = "Run command ",
author = "Dr.Mohammad",
description = "Run command every time",
version = "1.0.2",
url = "https://forums.alliedmods.net/showthread.php?t=314266"
}
public void OnPluginStart()
{
Cvar_Enable = CreateConVar("rc_enable", "1", "1=enable / 0=disable", _, true, 0.0, true, 1.0);
Cvar_MapName = CreateConVar("rc_map", "de_dust2", "change map every [rc_time] (Full Map Name)");
Cvar_Time = CreateConVar("rc_time", "3600", "time for run command");
}
public void OnMapStart()
{
if(Cvar_Enable.BoolValue)
{
Int_iTimer = 0;
CreateTimer(1.0 , Run_Command, _, TIMER_REPEAT);
}
}
public Action Run_Command(Handle Timer)
{
Int_iTimer++;
if(Int_iTimer >= Cvar_Time.IntValue)
{
char MapName[32];
GetConVarString(Cvar_MapName, MapName, sizeof(MapName));
ServerCommand("sm_map %s", MapName);
return Plugin_Stop;
}
return Plugin_Continue;
}
i compiled.