Raised This Month: $ Target: $400
 0% 

Not plays the music number 3


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 04-15-2013 , 15:54   Not plays the music number 3
Reply With Quote #1

Hi
I made this plugin, but it have one bug.
It doesnt plays music of Key number 3.
Well i have no idea why this happens. Problem isnt song, or precache. It precache the song right, and i know problem isnt song because i tried with anothers. The problem is that it doesnt plays the song number 3.

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Music Menu"
#define VERSION "3.5"
#define AUTHOR "Jhob94"

new Trie:g_tSongs
new g_iSongs

public plugin_precache()
{
    new 
configsdir[200]
    new 
configfile[200]
    
get_configsdir(configsdir,199)
    
format(configfile,199,"%s/music_menu.cfg",configsdir)
    new 
Data[255], charnum
    
new Left[64], Right[64]
    
    for(new 
ig_iSongsi++)
    {
        
read_file(configfile,i,Data,255,charnum)
        if(
strlen(Data)<|| Data[0] == ';' || equali(Data,"//",2))
                continue
            
        
strbreak(DataLeft63Right63)
        
remove_quotes(Left)
        
        
precache_generic(Left)    
    } 
}

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd"say /music",     "Music_Menu" )
    
register_clcmd"say_team /music",     "Music_Menu" )
}

public 
Music_Menuid 
{
    new 
menu menu_create("Music Menu""Music_Options")
    
menu_additem(menu"Stop The Music""1"0)
    
    
g_tSongs TrieCreate( )
    
    new 
configsdir[200]
    new 
configfile[200]
    new 
szNum[3]
    
get_configsdir(configsdir,199)
    
format(configfile,199,"%s/music_menu.cfg",configsdir)
    
g_iSongs file_size(configfile1)
    new 
Data[255], charnum
    
new Left[64], Right[64]
    
    for(new 
ig_iSongsi++)
    {
        
read_file(configfile,i,Data,255,charnum)
        if(
strlen(Data)<|| Data[0] == ';' || equali(Data,"//",2))
                continue
            
        
strbreak(DataLeft63Right63)
        
remove_quotes(Left)
        
remove_quotes(Right)
        
        
TrieSetString(g_tSongsRightLeft)
        
num_to_str(iszNum2)
        
menu_additem(menuRightszNum0)    
    } 
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0)
}

public 
Music_Options(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    new 
info[3], name[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessinfo2name63callback)
    
    new 
key str_to_num(info)
    
    if(
key == 1)
        
client_cmd(id"mp3 stop")
        
    else
    {
        new 
szSongName[64]
        
TrieGetString(g_tSongsnameszSongName63)
        
client_cmd(id"mp3 play %s"szSongName)
    }
    
    return 
PLUGIN_CONTINUE

Can some one help me? Need fix that for update in thread because last version have other bug that i fixed on this one.


EDIT:

It just happens with option 3 of menu. But if you go other page(more then 7 musics), 3 works. So basickly, what happens is that it doesnt loads the music that is in the line number 2 of cfg file.

Example of cfg file:
Code:
"media/Half-Life01.mp3" "Half-Life- 01"
"media/Half-Life02.mp3" "Half-Life- 02"
"media/Half-Life03.mp3" "Half-Life- 03"
"media/Half-Life04.mp3" "Half-Life- 04"
So on game when open menu it will show:
1. Stop music
2. Half-Life- 01
3. Half-Life- 02
4. Half-Life- 03
And music "Half-Life- 02" wont play. As i said isnt music problem, it happens with all songs that is on second line of cfg file.
__________________

Last edited by Jhob94; 04-16-2013 at 17:41. Reason: add more info
Jhob94 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 10:53.


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