Hey,
I have a plugin to shutdown the server, however, it's shutting down at the wrong time. The relevant code is below. Do I need to perhaps get the timezone first?
PHP Code:
public OnPluginStart() {
PrintToServer("ScheduledShutdown loaded successfully.");
CreateConVar("sm_scheduledshutdown_version", PL_VERSION, "ScheduledShutdown version.", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
g_hEnabledHint= CreateConVar("sm_scheduledshutdown_hintsay", "1", "Sets whether messages are shown in the hint area");
g_hEnabledChat= CreateConVar("sm_scheduledshutdown_chatsay", "1", "Sets whether messages are shown in chat");
g_hEnabledCenter = CreateConVar("sm_scheduledshutdown_centersay", "1", "Sets whether messages are shown in the center of the screen");
g_hEnabled = CreateConVar("sm_scheduledshutdown", "1", "Enable ScheduledShutdown.", FCVAR_PLUGIN);
g_hTime = CreateConVar("sm_scheduledshutdown_time", "0600", "Time to shutdown server.", FCVAR_PLUGIN);
HookConVarChange(g_hEnabled, Cvar_enabled);
HookConVarChange(g_hTime, Cvar_time);
}
public OnMapStart() {
CreateTimer(60.0, CheckTime, 0, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}
public OnConfigsExecuted() {
g_bEnabled = GetConVarBool(g_hEnabled);
decl String:iTime[8];
GetConVarString(g_hTime, iTime, sizeof(iTime));
g_iTime = StringToInt(iTime);
}
public Cvar_enabled(Handle:convar, const String:oldValue[], const String:newValue[]) {
g_bEnabled = GetConVarBool(g_hEnabled);
}
public Cvar_time(Handle:convar, const String:oldValue[], const String:newValue[]) {
decl String:iTime[8];
GetConVarString(g_hTime, iTime, sizeof(iTime));
g_iTime = StringToInt(iTime);
}
__________________