AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   music_menu(Server-BGM) (https://forums.alliedmods.net/showthread.php?t=5365)

+ARUKARI- 08-30-2004 01:55

music_menu(Server-BGM)
 
1 Attachment(s)
hi, I'm japanese.

I developed this so that all players could handle it.

This opens a MP3 file by the menu.

bind must do "music" to use this.

Example : bind f music

Crazed_climber 08-30-2004 02:28

2 things,
First where do you put the mp3s?
Secondly Is the precache of the mp3s automatic?

+ARUKARI- 08-30-2004 02:38

Quote:

Originally Posted by Crazed_climber
First where do you put the mp3s?

It's "mod(cstrike)/media/TR/".
Code:

Line28:format (mp3exec, 127,"mp3 play ^"media/TR/%s^"", mp3file)
Quote:

Secondly Is the precache of the mp3s automatic?
No
But, it is all right if this code is used.
Code:

public plugin_precache(){
        radiosprite = precache_model("sprites/radio.spr")
  precache_generic("media/TR/gas.mp3")
        precache_generic("media/TR/PD1.mp3")
        precache_generic("media/TR/PD2.mp3")
}

Besides, MP3 can be changed by changing this code.
Code:

public music_execmenu(id, key){

        switch(key)
                {
                case 0:
                                {
                                music_result ("gas.mp3", "Music Start! (BGM1)", id)
                                }
                case 1:
                                {
                                music_result ("PD1.mp3", "Music Start! (BGM2)", id)
                                }
                case 2:
                                {
                                music_result ("PD2.mp3", "Music Start! (BGM3)", id)
                                }
                case 3:
                                {
                                music_result ("", "STOP Music!", id)
                                }
                }
        return PLUGIN_HANDLED
}


BillyTheKid 08-30-2004 21:22

Quote:

Originally Posted by +ARUKARI-
Quote:

Originally Posted by Crazed_climber
First where do you put the mp3s?

It's "mod(cstrike)/media/TR/".
Code:

Line28:format (mp3exec, 127,"mp3 play ^"media/TR/%s^"", mp3file)
Quote:

Secondly Is the precache of the mp3s automatic?
No
But, it is all right if this code is used.
Code:

public plugin_precache(){
        radiosprite = precache_model("sprites/radio.spr")
  precache_generic("media/TR/gas.mp3")
        precache_generic("media/TR/PD1.mp3")
        precache_generic("media/TR/PD2.mp3")
}

Besides, MP3 can be changed by changing this code.
Code:

public music_execmenu(id, key){

        switch(key)
                {
                case 0:
                                {
                                music_result ("gas.mp3", "Music Start! (BGM1)", id)
                                }
                case 1:
                                {
                                music_result ("PD1.mp3", "Music Start! (BGM2)", id)
                                }
                case 2:
                                {
                                music_result ("PD2.mp3", "Music Start! (BGM3)", id)
                                }
                case 3:
                                {
                                music_result ("", "STOP Music!", id)
                                }
                }
        return PLUGIN_HANDLED
}


Your doing good man and nice plugin!!!!!!!!!!!!

+ARUKARI- 08-31-2004 00:37

Quote:

Originally Posted by BillyTheKid
Your doing good man and nice plugin!!!!!!!!!!!!

Thanks :D

kidbravo 10-13-2004 11:14

hi im a noob....

1. does everyone hear the music or just the person activating the sound?
also im using condition zero... where do i put the mp3s? thanks for anyhelp

BlueThunder2k 10-14-2004 03:25

dont got my aproval it doesn't work the menu works but no music is heard

+ARUKARI- 10-16-2004 22:33

How many or a problem was discovered with this plug-in.

I succeeded in modifying this.

Code:
#include <amxmodx> new get_mname[32] new get_numteam, get_mplayers[32] public music_showmenu(id){    if (!(is_user_alive(id))){       return PLUGIN_CONTINUE    }    new musicmenu[256]    new get_team[32]    get_user_name(id, get_mname, 31)    get_user_team(id, get_team, 31)    get_players(get_mplayers, get_numteam, "c", get_team)    format(musicmenu,256,"\yMusic Menu: %s^n\w^n1. BGM1^n2. BGM2^n3. BGM3^n4. BGM4^n5. BGM5^n6. STOP^n^n0. Cancel",get_mname)    show_menu(id,(1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9),musicmenu)    return PLUGIN_HANDLED } public music_result (mp3file[], printmsg[], id){       new musicmsg[128], mp3exec[1024]       client_cmd(0,"mp3 stop")       format (mp3exec, 1023,"mp3 play media/%s", mp3file) //MP3 regenerated command and the designation of the file place.       client_cmd(0, mp3exec)       format (musicmsg, 127, "%s (MUSIC): %s", get_mname, printmsg)       client_print(0, print_chat, musicmsg) } public music_execmenu(id, key){    //MP3s file name and the message when it regenerated    switch(key)       {       case 0:             {             music_result ("gas.mp3", "Music Start! (BGM1)", id)             }       case 1:             {             music_result ("PD1.mp3", "Music Start! (BGM2)", id)             }       case 2:             {             music_result ("PD2.mp3", "Music Start! (BGM3)", id)             }       case 3:             {             music_result ("C42.mp3", "Music Start! (BGM4)", id)             }       case 4:             {             music_result ("fam.mp3", "Music Start! (BGM5)", id)             }       case 5:             {             music_result ("", "STOP Music!", id)             }       }    return PLUGIN_HANDLED } public plugin_precache(){     //It uses when a file is uploaded automatically.    precache_generic("media/gas.mp3")    precache_generic("media/PD1.mp3")    precache_generic("media/PD2.mp3")    precache_generic("media/C42.mp3")    precache_generic("media/fam.mp3") } public plugin_init(){    register_plugin("Music Menu","1.22","+ARUKARI-")    register_menucmd(register_menuid("\yMusic Menu: "), 1023, "music_execmenu")    register_clcmd("music","music_showmenu",-1," - shows a menu of a Music commands")    return PLUGIN_CONTINUE }

Rewrite a Mp3s file name with everyone.
A problem must have disappeared with this.

default>

Mp3s in "mods/media"
ex)
"czero/media"
"cstrike/media"

bind key music
(Only a living person can use.)

This plug-in is used for the master as Server-BGM.

Mr. Solidus 10-21-2004 21:53

is there anyway u can make it play wavs? I've tried but it wont work...

+ARUKARI- 10-22-2004 04:18

this plugin is mp3 only

Should I make a wav version, too?


All times are GMT -4. The time now is 03:20.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.