HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <sdktools_sound>
  4.  
  5. #pragma semicolon 1
  6. #define MAX_FILE_LEN 80
  7. new Handle:g_CvarSoundName = INVALID_HANDLE;
  8. new String:g_soundName[MAX_FILE_LEN];
  9.  
  10. #define PLUGIN_VERSION "0.0.1"
  11. public Plugin:myinfo =
  12. {
  13. name = "Welcome Sound",
  14. author = "R-Hehl",
  15. description = "Plays Welcome Sound to connecting Players",
  16. version = PLUGIN_VERSION,
  17. url = "http://www.compactaim.de/"
  18. };
  19. public OnPluginStart()
  20. {
  21. // Create the rest of the cvar's
  22. CreateConVar("sm_welcome_snd_version", PLUGIN_VERSION, "Welcome Sound Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
  23. g_CvarSoundName = CreateConVar("sm_join_sound", "consnd/joinserver.mp3", "The sound to play");
  24. }
  25. public OnConfigsExecuted()
  26. {
  27. GetConVarString(g_CvarSoundName, g_soundName, MAX_FILE_LEN);
  28. decl String:buffer[MAX_FILE_LEN];
  29. PrecacheSound(g_soundName, true);
  30. Format(buffer, sizeof(buffer), "sound/%s", g_soundName);
  31. AddFileToDownloadsTable(buffer);
  32. }
  33. public OnClientPostAdminCheck(client)
  34. {
  35. EmitSoundToClient(client,g_soundName);
  36. }