Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- new szCMD[][]={"amx_addban", "amx_ban","amx_banip", "amx_kick", "fb_ban" },szSound[][]={
- "sound/szSound/haha.wav",
- "sound/szSound/lol.wav",
- "sound/szSound/lol2.wav",
- "sound/szSound/haha_v2.wav",
- "sound/szSound/whee.wav"
- },i;
- public plugin_init()
- {
- register_plugin("Sound Commmand","1.0","Seroff");
- for(i=0;i<sizeof(szCMD);i++){
- register_concmd(szCMD[i], "sendsound");
- }
- }
- public plugin_precache() {
- for(i=0;i<sizeof(szSound);i++){
- precache_generic(szSound[i]);
- }
- }
- public sendsound(id){
- new szRandom=random_num(0,sizeof(szSound));
- play_sound(0,szSound[szRandom]);
- }
- stock play_sound(id, sound[], pitch = PITCH_NORM, bool:reliable = false)
- {
- static msg_index;
- if(!msg_index) msg_index = get_user_msgid("SendAudio");
- message_begin(reliable ? (id ? MSG_ONE : MSG_ALL) : (id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST), msg_index, _, id);
- write_byte(id);
- write_string(sound);
- write_short(pitch);
- message_end();
- }
Advertisement
Add Comment
Please, Sign In to add comment