The hint text shows, but the sounds aren't
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <emitsoundany>
new Handle:Countdown = INVALID_HANDLE;
new Second;
public Plugin:myinfo =
{
name = "Privat",
author = "Mado",
description = "none",
version = "X",
url = "."
};
public OnPluginStart()
{
HookEvent("round_start", OnRoundStart);
AddFileToDownloadsTable("sound/furienmdx/countdown/1.mp3");
AddFileToDownloadsTable("sound/furienmdx/countdown/2.mp3");
AddFileToDownloadsTable("sound/furienmdx/countdown/3.mp3");
AddFileToDownloadsTable("sound/furienmdx/countdown/4.mp3");
AddFileToDownloadsTable("sound/furienmdx/countdown/5.mp3");
PrecacheSoundAny("furienmdx/countdown/1.mp3");
PrecacheSoundAny("furienmdx/countdown/2.mp3");
PrecacheSoundAny("furienmdx/countdown/3.mp3");
PrecacheSoundAny("furienmdx/countdown/4.mp3");
PrecacheSoundAny("furienmdx/countdown/5.mp3");
}
public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
Second = 5;
EmitSoundToAllAny("furienmdx/countdown/5.mp3");
Countdown = CreateTimer(1.0, Timer_4, _, TIMER_DATA_HNDL_CLOSE );
Countdown = CreateTimer(2.0, Timer_3, _, TIMER_DATA_HNDL_CLOSE );
Countdown = CreateTimer(3.0, Timer_2, _, TIMER_DATA_HNDL_CLOSE );
Countdown = CreateTimer(4.0, Timer_1, _, TIMER_DATA_HNDL_CLOSE );
Countdown = CreateTimer(5.0, Timer_0, _, TIMER_DATA_HNDL_CLOSE);
PrintHintTextToAll("<font color='#ff0000'><b>5 Second(s) remaning</b></font>");
}
public Action:Timer_4(Handle:Timer)
{
EmitSoundToAllAny("furienmdx/countdown/4.mp3");
PrintHintTextToAll("<font color='#00ffde'><b>4 Second(s) remaning</b></font>");
}
public Action:Timer_3(Handle:Timer)
{
EmitSoundToAllAny("furienmdx/countdown/3.mp3");
PrintHintTextToAll("<font color='#00ff00'><b>3 Second(s) remaning</b></font>");
}
public Action:Timer_2(Handle:Timer)
{
EmitSoundToAllAny("furienmdx/countdown/2.mp3");
PrintHintTextToAll("<font color='#fffc00'><b>2 Second(s) remaning</b></font>");
}
public Action:Timer_1(Handle:Timer)
{
EmitSoundToAllAny("furienmdx/countdown/1.mp3");
PrintHintTextToAll("<font color='#ff9500'><b>1 Second(s) remaning</b></font>");
}
public Action:Timer_0(Handle:Timer)
{
PrintHintTextToAll("<font color='#ff0000'><b>ATTACK!!!</b></font>")
if (Second == 0)
KillTimer(Countdown);
}
I get those things...
PHP Code:
SV_StartSound: *furienmdx/countdown/4.mp3 not precached (0)
12/22/2015 - 10:40:40: [SM] Plugin "countdown.smx" encountered error 23: Native detected error
12/22/2015 - 10:40:40: [SM] Invalid data handle 0 (error 4) passed during timer end with TIMER_DATA_HNDL_CLOSE
12/22/2015 - 10:40:40: [SM] Unable to call function "Timer_4" due to above error(s).
SV_StartSound: *furienmdx/countdown/3.mp3 not precached (0)
12/22/2015 - 10:40:41: [SM] Plugin "countdown.smx" encountered error 23: Native detected error
12/22/2015 - 10:40:41: [SM] Invalid data handle 0 (error 4) passed during timer end with TIMER_DATA_HNDL_CLOSE
12/22/2015 - 10:40:41: [SM] Unable to call function "Timer_3" due to above error(s).
SV_StartSound: *furienmdx/countdown/2.mp3 not precached (0)
12/22/2015 - 10:40:42: [SM] Plugin "countdown.smx" encountered error 23: Native detected error
12/22/2015 - 10:40:42: [SM] Invalid data handle 0 (error 4) passed during timer end with TIMER_DATA_HNDL_CLOSE
12/22/2015 - 10:40:42: [SM] Unable to call function "Timer_2" due to above error(s).
SV_StartSound: *furienmdx/countdown/1.mp3 not precached (0)
12/22/2015 - 10:40:43: [SM] Plugin "countdown.smx" encountered error 23: Native detected error
12/22/2015 - 10:40:43: [SM] Invalid data handle 0 (error 4) passed during timer end with TIMER_DATA_HNDL_CLOSE
12/22/2015 - 10:40:43: [SM] Unable to call function "Timer_1" due to above error(s).
12/22/2015 - 10:40:44: World triggered "Round_Start"
12/22/2015 - 10:40:44: [SM] Plugin "countdown.smx" encountered error 23: Native detected error
12/22/2015 - 10:40:44: [SM] Invalid data handle 0 (error 4) passed during timer end with TIMER_DATA_HNDL_CLOSE
I also tried with TIMER_REPEAT instead of TIMER_DATA_HNDL_CLOSE and it makes it an infinite countdown that gets faster every round and never stops. It's like 543214231231231234123434... .
And KillTimer doesn't work when I use TIMER_REPEAT... I also tried with return Plugin_Stop;
Don't tell me that sounds aren't precached, it works with TIMER_REPEAT, but the countdown doesn't stop at 0.
__________________