PHP Code:
#include <sourcemod>
#include <sdktools> //need for adding files to download table
#include <overlays>
//Compiler Options //Optional, but please keep your code clean!
#pragma semicolon 1
#pragma newdecls required
int iAmmount;
public void OnPluginStart()
{
HookEvent("round_start", Event_RoundStart);
RegConsoleCmd("sm_testoverlay", Command_TestOverlay, "Show overlay to client");
}
public void OnMapStart()
{
for (int i = 1; i < 11;i++)
{
char path[128];
Format(path, 128, "overlays/holigan_hud3/count/zombie/%d", i);
PrecacheDecalAnyDownload(path);
}
}
public Action Event_RoundStart(Handle event, const char[] name, bool dontBroadcast)
{
iAmmount = 10;
CreateTimer(20.0, Timer_CountDown, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}
public Action Timer_CountDown(Handle timer, any data)
{
if (iAmmount == 0)
return Plugin_Stop;
else if(iAmmount<=10)
{
char path[128];
Format(path, 128, "overlays/holigan_hud3/count/zombie/%d", iAmmount);
ShowOverlayAll(path, 1.0);
}
iAmmount--;
return Plugin_Continue;
}
public Action Command_TestOverlay(int client, int args)
{
ShowOverlayAll("overlays/holigan_hud3/count/zombie/10", 1.0);
return Plugin_Handled;
}
Okay i change iAmount to 10 and changed timer to 20. Overlay 10 is working but other overlays not.