Reikia padaryti (jeigu įmanoma):
1. Kad liktų esamas mp3_volume (kad jis nepasikeistų į 1).
2. Kai žaidėjas prisijungia į serverį, pasirenka team'ą ir class, jam iškart parodo dainų meniu.
Code: Select all
#include <amxmodx>#include <amxmisc> new const g_File[] = "songs.ini"; new g_Path[64]; public plugin_precache(){ get_configsdir(g_Path, 63); format(g_Path, 63, "%s/%s", g_Path, g_File); new File = fopen(g_Path, "r"); if (!File) return; new Song[128]; while (!feof(File)) { fgets(File, Song, 127); parse(Song, Song, 127); precache_generic(Song); }} public plugin_init(){ register_plugin("Music", "1.0", "hleV"); register_clcmd("say /music", "SayMusic");} public SayMusic(Client){ new Menu = menu_create("Choose your song^n(will set ^"mp3volume^" to ^"1^")^n", "MusicMenu"); menu_additem(Menu, "Stop current song", "0"); new File = fopen(g_Path, "r"); if (File) { new Path[192], Song[64]; while (!feof(File)) { fgets(File, Path, 191); parse(Path, Path, 127, Song, 63); menu_additem(Menu, Song, Path); } } menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL); menu_display(Client, Menu);} public MusicMenu(Client, Menu, Item){ if (Item == MENU_EXIT) { menu_destroy(Menu); return; } new Access, Song[128], Callback; menu_item_getinfo(Menu, Item, Access, Song, 127, _, _, Callback); if (!Song[0]) { client_cmd(Client, "mp3 stop"); return; } client_cmd(Client, "mp3volume 1"); client_cmd(Client, "mp3 play ^"%s^"", Song);}