ALSO WANTED SO THAT THE COUNTER SHOWS TIMER, But Declaring the timer g_XYZ = CreateTimer Says Function Prototype Mismatch.// C:\Users\Kushal\Desktop\scripting\AutoFS.sp(41) : warning 219: local variable "status" shadows a variable at a preceding level
// C:\Users\Kushal\Desktop\scripting\AutoFS.sp(41) : warning 204: symbol is assigned a value that is never used: "status"
Help To Initiate The Code Better.
C++:
public OnAllPluginsLoaded()
{
g_h_Status = FindConVar("wm_status");
int status = g_h_Status.IntValue;
HookConVarChange(g_h_Status, OnChanges);
}
public OnChanges(Handle cvar, const char[] oldVal, const char[] newVal)
{
if (CS_GetPlayingCount() == 10 && status == 0)
{
CreateTimer(1.0, Command_Forcestart, _, TIMER_REPEAT);
PrintCenterTextAll("Force Start Initiated.");
}
PrintHintTextToAll("Starting Force Start When Ten Players Are Present.");
public Action Command_Forcestart(Handle timer)
{
CreateTimer(15.0, Command_WarStart);
PrintCenterTextAll("Automatic Starting Force Start in 20 Seconds.");
PrintHintTextToAll("Starting Force Start in 20 Seconds.");
}
public Action Command_WarStart(Handle timer)
{
if (CS_GetPlayingCount() == 10)
{
ServerCommand("fs");
}
}
}