just a bit better to read
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
#include <sdktools>
|
#include <sdktools>
|
||||||
|
|
||||||
int map_switches_count = -1;
|
int map_switches_count = -1;
|
||||||
char g_cMaps[500][256];
|
char g_cMaps[800][256];
|
||||||
|
int g_i_rotate_time = 1;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
@@ -16,11 +17,20 @@ public Plugin myinfo =
|
|||||||
url = "www.unloze.com"
|
url = "www.unloze.com"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public void Cvar_rotate_time(ConVar convar, const char[] oldValue, const char[] newValue)
|
||||||
|
{
|
||||||
|
g_i_rotate_time = convar.IntValue;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
public void OnPluginStart()
|
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);
|
RegAdminCmd("sm_restartmaps_test", cmd_restart_the_map, ADMFLAG_GENERIC);
|
||||||
|
|
||||||
new Handle:fileHandle = OpenFile("wtf.txt", "r" );
|
new Handle:fileHandle = OpenFile("wtf.txt", "r" );
|
||||||
@@ -45,17 +55,17 @@ public Action cmd_restart_the_map(int client, int args)
|
|||||||
|
|
||||||
public void OnMapStart()
|
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)
|
public Action time_query_activity(Handle timer, any data)
|
||||||
{
|
{
|
||||||
LogError("restart count reached: %i", map_switches_count);
|
|
||||||
int local = map_switches_count;
|
int local = map_switches_count;
|
||||||
map_switches_count++;
|
map_switches_count++;
|
||||||
|
LogError("restart count reached: %i. nextmap: %s", map_switches_count, g_cMaps[local]);
|
||||||
ForceChangeLevel(g_cMaps[local], "");
|
ForceChangeLevel(g_cMaps[local], "");
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user