Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. public int LoadSounds(ArrayList arraySounds, ConVar pathConVar)
  2. {
  3. ArrayList.Clear(arraySounds);
  4. char soundPath[256];
  5. char soundPathFull[256];
  6. GetConVarString(pathConVar, soundPath, 256);
  7. Format(soundPathFull, 256, "sound/%s/", soundPath);
  8. DirectoryListing pluginsDir = OpenDirectory(soundPathFull, false, "GAME");
  9. if (pluginsDir)
  10. {
  11. char fileName[128];
  12. while (DirectoryListing.GetNext(pluginsDir, fileName, 128, 0))
  13. {
  14. int extPosition = strlen(fileName) + -4;
  15. if (extPosition == StrContains(fileName, ".mp3", false))
  16. {
  17. char soundName[512];
  18. Format(soundName, 512, "sound/%s/%s", soundPath, fileName);
  19. AddFileToDownloadsTable(soundName);
  20. Format(soundName, 512, "%s/%s", soundPath, fileName);
  21. PrecacheSoundAny(soundName, false);
  22. ArrayList.PushString(arraySounds, soundName);
  23. }
  24. }
  25. }
  26. return ArrayList.Length.get(arraySounds);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement