seroff

stock Play Sound

Jan 18th, 2016
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. #define Sound "events/friend_died.wav"
  4.  
  5. public plugin_init() {
  6. register_plugin("Play Sound","1.0","Seroff");
  7. register_clcmd("sond","snd");
  8. }
  9.  
  10. public snd(id){
  11. play_sound(id, Sound);
  12. }
  13.  
  14. stock play_sound(id, sound[], pitch = PITCH_NORM, bool:reliable = false)
  15. {
  16. static msg_index
  17. if(!msg_index) msg_index = get_user_msgid("SendAudio")
  18. message_begin(reliable ? (id ? MSG_ONE : MSG_ALL) : (id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST), msg_index, _, id)
  19. write_byte(id)
  20. write_string(sound)
  21. write_short(pitch)
  22. message_end()
  23. }
Advertisement
Add Comment
Please, Sign In to add comment