just a bit better to read

This commit is contained in:
jenz
2026-07-31 23:40:10 +02:00
parent 5a53772941
commit e0e043d2ad
@@ -2,7 +2,8 @@
#include <sdktools>
int map_switches_count = -1;
char g_cMaps[500][256];
char g_cMaps[800][256];
int g_i_rotate_time = 1;
//----------------------------------------------------------------------------------------------------
// Purpose:
@@ -16,11 +17,20 @@ public Plugin myinfo =
url = "www.unloze.com"
};
public void Cvar_rotate_time(ConVar convar, const char[] oldValue, const char[] newValue)
{
g_i_rotate_time = convar.IntValue;
}
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void OnPluginStart()
{
ConVar cvar;
HookConVarChange((cvar = CreateConVar("sm_map_rotating_time", "5", "time in seconds for map rotation")), Cvar_rotate_time);
g_i_rotate_time = cvar.IntValue;
delete cvar;
RegAdminCmd("sm_restartmaps_test", cmd_restart_the_map, ADMFLAG_GENERIC);
new Handle:fileHandle = OpenFile("wtf.txt", "r" );
@@ -45,17 +55,17 @@ public Action cmd_restart_the_map(int client, int args)
public void OnMapStart()
{
if (map_switches_count != -1 && map_switches_count < 400)
if (map_switches_count != -1 && map_switches_count < 500)
{
CreateTimer(5.0, time_query_activity);
CreateTimer(float(g_i_rotate_time), time_query_activity);
}
}
public Action time_query_activity(Handle timer, any data)
{
LogError("restart count reached: %i", map_switches_count);
int local = map_switches_count;
map_switches_count++;
LogError("restart count reached: %i. nextmap: %s", map_switches_count, g_cMaps[local]);
ForceChangeLevel(g_cMaps[local], "");
return Plugin_Handled;
}