Raised This Month: $ Target: $400
 0% 

need help edit my music player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
mando127
Veteran Member
Join Date: Dec 2006
Location: virginia
Old 02-05-2010 , 10:30   need help edit my music player
Reply With Quote #1

i need to take out the random part and make it play the music one by one and repeat.




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


#define PLUGIN "Music"
#define VERSION "1.1"
#define AUTHOR "it"

new const music[][] = {
    "sound/007mod/credits.mp3",
    "sound/007mod/caverns.mp3",
    "sound/007mod/complex.mp3",
    "sound/007mod/escape.mp3",
    "sound/007mod/facility.mp3",
    "sound/007mod/frigate.mp3",
    "sound/007mod/runway.mp3",
    "sound/007mod/satellite.mp3"
}

new g_maxplayers2;

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)

    register_logevent("Round_started", 2, "1=Round_Start");
    register_logevent("logevent_round_end2", 2, "1=Round_End") 

    register_clcmd("say /playsong", "PlayMusic");
    register_clcmd("say playsong", "PlayMusic");
    register_clcmd("say /nextsong", "PlayMusic");
    register_clcmd("say nextsong", "PlayMusic");
    register_clcmd("say /stopsong", "StopMusic");
    register_clcmd("say stopsong", "StopMusic");
    g_maxplayers2  = get_maxplayers()
}
public PlayMusic(Client)
        client_cmd(Client, "mp3 play %s", music[random_num(0,sizeof music - 1)])
public StopMusic(Client)
        client_cmd(Client, "mp3 stop"); 
public plugin_precache() {
    for(new i = 0; i < sizeof music; i++)
        precache_generic(music[i])
}
public Round_started() 
{
    set_task(5.0, "setPlayMusic1")
} 
public logevent_round_end2()
{
    static id
    for (id = 1; id <= g_maxplayers2; id++)
    {
        // Not connected
        if (!is_user_connected(id))
            continue;
    
        client_cmd(id, "mp3 stop");

        remove_task(id);
    }
} 
public setPlayMusic1()
{
    client_cmd(0, "mp3 play %s", music[random_num(0,sizeof music - 1)])
}
__________________
mando127 is offline
Send a message via Skype™ to mando127
 



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 07:24.


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