Raised This Month: $ Target: $400
 0% 

Music Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eskemo
Senior Member
Join Date: Dec 2008
Location: Australia
Old 01-15-2011 , 00:58   Music Menu
Reply With Quote #1

Hello, I just made this. Was bored. Thought it'd be a great idea on server's although I can't exactly post it in plugin submission's as you have to edit the code for your own sounds.

Quote:
////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// Music Menu //
// This plugin simple add's a menu to the game which play's music once you press the number. //
// //
// Credits : //
// Emps` scripting menu tut @ https://forums.alliedmods.net/showth...6364#BasicMenu //
// //
// //
////////////////////////////////////////////////////////////////////////////////////////////////////
register_clcmd("say /music", "music_menu") is telling the menu that the client wants to access it. So you say /menu in game! and a meny will appear.
Quote:
#include <amxmodx>
#include <amxmisc>

public plugin_init() {
register_plugin("Music Menu", "1.1", "eskemo")
register_clcmd("say /music", "music_menu")
register_clcmd("say_team /music", "music_menu")
}
Here you need to add the songs names you want with .wav then add them to sound/music/ folder in ur server.

Quote:
public plugin_precache()
{
precache_sound("music/")
precache_sound("music/")
precache_sound("music/")
precache_sound("music/")
precache_sound("music/")
precache_sound("music/")
precache_sound("music/")
}
/w simpolise the colour which is white. then you change Song1 to the song name and so on so on so on.
If you want a few less songs. delete that or those menu items.
Quote:
public music_menu(id)
{
new menu = menu_create("\rMusic Menu:", "menu_handler");
menu_additem(menu, "\wSong1", "1", 0);
menu_additem(menu, "\wSong2", "2", 0);
menu_additem(menu, "\wSong3", "3", 0);
menu_additem(menu, "\wSong4", "4", 0);
menu_additem(menu, "\wSong5", "5", 0);
menu_additem(menu, "\wSong6", "6", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
Change this "spk music/" to make it have what you put in your precache. Also if you want less items. such as what i said on menu_additem. delete the number that matches it .
Quote:
public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}

new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

new key = str_to_num(data);

switch(key)
{
case 1:
{
client_cmd(0,"spk music/")
client_print(id, print_chat, "Your song has now started playing.");

menu_destroy(menu);
return PLUGIN_HANDLED;
}

case 2:
{
client_cmd(0,"spk music/")
client_print(id, print_chat, "Your song has now started playing.");

menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 3:
{
client_cmd(0,"spk music/")
client_print(id, print_chat, "Your song has now started playing.");

menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 4:
{
client_cmd(0,"spk music/")
client_print(id, print_chat, "Your song has now started playing.");

menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 5:
{
client_cmd(0,"spk music/")
client_print(id, print_chat, "Your song has now started playing.");

menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 6:
{
client_cmd(0,"spk music/")
client_print(id, print_chat, "Your song has now started playing.");

menu_destroy(menu);
return PLUGIN_HANDLED;
}
}

menu_destroy(menu);
return PLUGIN_HANDLED;
}
I know i didn't explain this very well. But i guess you can always ask for more help!
__________________


Free Australian FASTDL Server PM ME
eskemo is offline
snowyledge
BANNED
Join Date: Dec 2009
Old 01-15-2011 , 12:41   Re: Music Menu
Reply With Quote #2

Yeah that would be a good plugin release. Make it to .wav and .mp3 because I don't save my mp3 I download for hldj songs.
snowyledge is offline
eskemo
Senior Member
Join Date: Dec 2008
Location: Australia
Old 01-15-2011 , 19:39   Re: Music Menu
Reply With Quote #3

I'm only new @ scripting so I am unsure if it works for .mp3 + .wav ? I will test it now and just see if it works with both
__________________


Free Australian FASTDL Server PM ME
eskemo is offline
infek
Senior Member
Join Date: May 2009
Location: Behind you
Old 01-15-2011 , 19:56   Re: Music Menu
Reply With Quote #4

@eskemo: only .mp3's and .wav's work for hl1
__________________
"Domo Arigato, Mr. Roboto!"
PM me if you want to know a secret
infek is offline
eskemo
Senior Member
Join Date: Dec 2008
Location: Australia
Old 01-15-2011 , 21:04   Re: Music Menu
Reply With Quote #5

Yer I just added a .mp3 to my script didnt work :S
__________________


Free Australian FASTDL Server PM ME
eskemo is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:05.


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