Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int LoadSounds(ArrayList arraySounds, ConVar pathConVar)
- {
- ArrayList.Clear(arraySounds);
- char soundPath[256];
- char soundPathFull[256];
- GetConVarString(pathConVar, soundPath, 256);
- Format(soundPathFull, 256, "sound/%s/", soundPath);
- DirectoryListing pluginsDir = OpenDirectory(soundPathFull, false, "GAME");
- if (pluginsDir)
- {
- char fileName[128];
- while (DirectoryListing.GetNext(pluginsDir, fileName, 128, 0))
- {
- int extPosition = strlen(fileName) + -4;
- if (extPosition == StrContains(fileName, ".mp3", false))
- {
- char soundName[512];
- Format(soundName, 512, "sound/%s/%s", soundPath, fileName);
- AddFileToDownloadsTable(soundName);
- Format(soundName, 512, "%s/%s", soundPath, fileName);
- PrecacheSoundAny(soundName, false);
- ArrayList.PushString(arraySounds, soundName);
- }
- }
- }
- return ArrayList.Length.get(arraySounds);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement