Hello,
I'm am attempting to do the exact same thing, but I have not been successful as of yet. I have tried my best to follow the thread and attempted to reconstruct it properly.
I have the falling in my description file.
// ================================================================================
class CfgSounds
{
sounds[] = {Adhan};
class adhan
{
name = "Adhan";
sound[] = {"Adhan.ogg", db+0, 1.0};
titles[] = {0,""};
};
};;
//================================================================================
I have the Adhan.ogg file within a folder called "Sound" which is where I understand it is suppost to be located.
I have created a SQF file called "prayer" and within, it contains the following code:
_gamelogic="logic" createVehicleLocal [0,0,0];
_times_to_play = [5, 12, 15, 18, 19];
_played_times = [0, 0, 0, 0, 0];
_i = 0;
while {true} do
{
_i = 0;
{
if (abs (dayTime - _x) < 0.05) then
{
if ((_played_times select _i) == 0) then
{
_played_times set [_i, 1];
_gamelogic say "Adhan";
};
};
_i = _i + 1;
} forEach _times_to_play;
if (dayTime > ((_times_to_play select 4) + 0.1)) then
{
_played_times = [0, 0, 0, 0, 0];
};
Sleep 10;
};
In my init.sqf file, I have the following:
[]execVM "prayer.sqf";
So is my coding valid? I have not recieved an error from the game when loading it. But I'm not getting a sound as of yet. I would like the sound to come from a couple of Minarets. Is that possiable? How would I go about making the sound come from a specfic minaret? That for your help!