eLLectro • 11-07-2025, 02:19 PM
#1
[Image: 972d5016-33e6-4a24-af7a-39ef1927bf63.png]

xmas sounds for round end

Add a touch of Christmas spirit to your server with this festive sound plugin! This plugin plays cheerful Christmas-themed sounds or music at the end of each round, bringing a warm holiday vibe to your gameplay.

Code: 
#include <amxmodx>

#define NUMAR_SUNETE_T 3
#define NUMAR_SUNETE_CT 3

new const Christmas_Sounds_T[NUMAR_SUNETE_T][] = {

//       "xmas/xmas_te1.mp3",
//       "xmas/xmas_te2.mp3",
         "xmas/xmas_te3.mp3",
         "xmas/xmas_te4.mp3",
         "xmas/xmas_te5.mp3"
}  

new const Christmas_Sounds_CT[NUMAR_SUNETE_CT][] = {

//       "xmas/xmas_ct1.mp3",
//       "xmas/xmas_ct2.mp3",
//       "xmas/xmas_ct3.mp3",
         "xmas/xmas_ct4.mp3",
         "xmas/xmas_ct5.mp3",
         "xmas/xmas_ct6.mp3"
}

public plugin_init() {

      register_plugin("[XMAS] RoundSounds","1.0","A k c 3 n 7");

      register_message( get_user_msgid( "SendAudio" ),"message_sendaudio" );

      register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin");

      register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin");
}

public t_win() {
  
      PlaySoundToClients (Christmas_Sounds_T[random(NUMAR_SUNETE_T)]);
}

public ct_win() {

      PlaySoundToClients (Christmas_Sounds_CT[random(NUMAR_SUNETE_CT)]);
}

public plugin_precache() {

      for(new i = 0; i < NUMAR_SUNETE_T; i ++)
      precache_sound(Christmas_Sounds_T[i]);

      for(new i = 0; i < NUMAR_SUNETE_CT; i ++)
      precache_sound(Christmas_Sounds_CT[i]);
}

public message_sendaudio( msg_id, msg_dest, msg_entity ) {
    
        static message[10];
        get_msg_arg_string( 2, message, sizeof message - 1 );

        switch( message[7] )
        {
            case 'c', 't', 'r' : return PLUGIN_HANDLED;
        }

        return PLUGIN_CONTINUE;
   }  
  
PlaySoundToClients ( const sound [ ] ) {

        if ( equal ( sound [ strlen ( sound ) -4 ], ".mp3" ) )
                client_cmd ( 0, "mp3 play ^"sound/%s^"", sound );
        else
                client_cmd ( 0, "spk ^"%s^"", sound );
}

VersionAuthorRequirementsMod for
1.0.0A k c 3 n 7AMX Mod XClassic / Xmas
 Attached Files
.zip xmas sound.zip
(Size: 3.38 MB Downloads: 21)
This post was last modified: 11-07-2025, 02:20 PM by eLLectro.
Users browsing this thread: 1 Guest(s)
Powered By MyBB Group © 2026
Made with by ZMBIO.RO