Hello!
How do you pass an array with other variables?
The code below does not work. This is my vision.
PHP Code:
public Action Test(client, args)
{
MyFunc(MyArray, "sound/hit/", "kevlar"); // How do you pass an array with other variables?
}
void MyFunc(const array[], char sPath, Filtr)
{
new Handle:dir;
if ((dir = OpenDirectory(sPath)))
{
char name[128];
char path[PLATFORM_MAX_PATH];
new FileType:type;
while (ReadDirEntry(dir, name, 128, type))
{
if (type == FileType_File)
{
if (StrEqual(name[strlen(name) - 4], ".wav", false) || (StrEqual(name[strlen(name) - 4], ".mp3", false)))
{
if (StrContains(name, Filtr, false) != -1)
{
FormatEx(path, sizeof(path), "%s/%s", sPath, name);
array.PushString(path);
}
}
}
}
CloseHandle(dir);
}
else
LogError("Failed to open directory: %s", sPath);
}