Just put all the multilingual audios into one .wav file and do it like "spk sound(s10e14)". And the directory limitation is that you can only put them into the folder sound/. but i can be kinda hard since you have to put percentage and i don't think that floating points are allowed.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <xs>
const MaxSoundAtOnce = 2;
const MaxSoundLen = 128;
enum SoundData
{
SD_Sound[MaxSoundLen], // String
Float:SD_Start, // Percentage/100
Float:SD_End, // Percentage/100
Float:SD_Duration, // Seconds
Float:SD_Volume, // Percentage/100
Float:SD_Distance
}
enum PlayerData
{
Float:PD_Pos,
Float:PD_Volume,
Float:PD_StartTime,
PD_Id
}
new g_Sounds[][SoundData] = {
{"hello", 0.0, 1.0, 2.0, 1.0, 100.0}
}
new g_PlayerSound[MAX_PLAYERS + 1][MaxSoundAtOnce][PlayerData],
g_iPlaying[MAX_PLAYERS + 1],
g_iChangeSound[MAX_PLAYERS + 1][2]; // {Which, With}
public plugin_init()
{
register_clcmd("say hello", "cmdStart");
}
public cmdStart(id)
{
if(g_iPlaying[id] == MaxSoundAtOnce)
{
if(g_iChangeSound[id][0] == MaxSoundAtOnce)
g_iChangeSound[id][0] = 0;
g_iChangeSound[id][1] = 0;
}
else
{
g_PlayerSound[id][g_iPlaying[id]][PD_Volume] = g_Sounds[0][SD_Volume];
g_PlayerSound[id][g_iPlaying[id]][PD_StartTime] = get_gametime();
g_PlayerSound[id][g_iPlaying[id]][PD_Id] = 0;
g_iPlaying[id]++;
}
}
public client_PreThink(pId)
{
if(!g_iPlaying[pId])
return;
new players[MAX_PLAYERS], num, id, i, z;
get_players(players, num, "i");
new Float:startPos, sound, Float:volume;
new Float:distance, Float:flVec[3], Float:flVec2[3];
static Float:gametime; gametime = get_gametime();
for(i = 0; i < MaxSoundAtOnce; i++)
{
for(z = 0; z < num; z++)
{
id = players[z];
sound = g_PlayerSound[id][i][PD_Id];
if(sound == -1)
continue;
if(g_iChangeSound[i][0] == i && g_iChangeSound[i][1] > -1)
{
client_cmd(id, "spk ^"%s(v0)^"", g_Sounds[sound][SD_Sound]);
g_PlayerSound[id][i][PD_Volume] = g_Sounds[g_iChangeSound[id][1]][SD_Volume];
g_PlayerSound[id][i][PD_StartTime] = gametime;
g_PlayerSound[id][i][PD_Id] = g_iChangeSound[id][1];
g_iChangeSound[id][1] = -1;
continue;
}
startPos = g_Sounds[sound][SD_Start];
g_PlayerSound[id][i][PD_Pos] = startPos + gametime - g_PlayerSound[id][i][PD_StartTime];
if(g_PlayerSound[id][i][PD_Pos] >= g_Sounds[sound][SD_Duration])
{
g_PlayerSound[id][i][PD_Id] = -1;
g_iPlaying[id]--;
continue;
}
startPos = g_PlayerSound[id][i][PD_Pos] / g_Sounds[sound][SD_Duration] * 100.0;
if(id == pId)
{
volume = g_PlayerSound[id][i][PD_Volume] * g_Sounds[sound][SD_Volume] * 100.0;
}
else
{
pev(id, pev_origin, flVec);
pev(pId, pev_origin, flVec2);
if((distance = xs_vec_distance(flVec, flVec2)) > g_Sounds[sound][SD_Distance])
{
client_cmd(id, "spk ^"%s(v0)^"", g_Sounds[sound][SD_Sound]);
continue;
}
volume = (g_PlayerSound[id][i][PD_Volume] * g_Sounds[sound][SD_Volume]) * distance/g_Sounds[sound][SD_Distance] * 100.0;
}
client_cmd(id, "spk ^"%s(v%.2fs%.2fe%.2f)^"", g_Sounds[sound][SD_Sound], volume, startPos, startPos+1.0);
}
}
}
Edit: P.S. It's an idea code not exactly a working one i assume.