HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #define Maxsounds 1
  3. new soundlist[Maxsounds][] = {"misc/rtpn"} //zene neve és helye
  4.  
  5. new plugin_author[] = "White Panther" // készitõ
  6. new plugin_version[] = "1.2.3" // verzió
  7.  
  8. public plugin_init( )
  9. {
  10. register_plugin("Connect Sound", plugin_version, plugin_author)
  11. register_cvar("connectsound_version", plugin_version, FCVAR_SERVER)
  12. }
  13.  
  14. public plugin_precache( )
  15. {
  16. new temp[128], soundfile[128]
  17. for ( new a = 0; a < Maxsounds; a++ )
  18. {
  19. format(temp, 127, "sound/%s.wav", soundlist[a])
  20. if ( file_exists(temp) )
  21. {
  22. format(soundfile, 127, "%s.wav", soundlist[a])
  23. precache_sound(soundfile)
  24. }
  25. }
  26. }
  27.  
  28. public client_putinserver( id )
  29. {
  30. set_task(1.0, "consound", 100 + id)
  31. }
  32.  
  33. public consound( timerid_id )
  34. {
  35. new id = timerid_id - 100
  36. new Usertime
  37. Usertime = get_user_time(id, 0)
  38. if ( Usertime <= 0 )
  39. {
  40. set_task(1.0, "consound", timerid_id)
  41. }else
  42. {
  43. new i = random(Maxsounds)
  44. client_cmd(id, "spk ^"%s^"", soundlist[i])
  45. }
  46.  
  47. return PLUGIN_CONTINUE
  48. }