// LoadSound
public OnConfigsExecuted_VoteSound()
{
if(GetConVarBool(g_Cvar_Sound[Sound_Enable]))
{
decl String:sound[255], String:filePath[255];
// VoteStart
GetConVarString(g_Cvar_Sound[Sound_VoteStart], sound, sizeof(sound));
if(strlen(sound) > 0)
{
Format(filePath, sizeof(filePath), "%s", sound);
AddFileToDownloadsTable(filePath);
PrecacheSound(sound, true);
if(!FileExists(filePath))
LogError("sound file %s does not exist.", sound);
else if(!IsSoundPrecached(filePath))
LogError("failed to precache sound file %s", sound);
}
// VoteEnd
GetConVarString(g_Cvar_Sound[Sound_VoteEnd], sound, sizeof(sound));
if(strlen(sound) > 0)
{
Format(filePath, sizeof(filePath), "%s", sound);
AddFileToDownloadsTable(filePath);
PrecacheSound(sound, true);
if(!FileExists(filePath))
LogError("sound file %s does not exist.", sound);
else if(!IsSoundPrecached(filePath))
LogError("failed to precache sound file %s", sound);
}
}
}