Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loading Music
#1
This is a simple plugin that plays music while the screen is loading and then stops when the player joins the server. You can replace the file needed for download.

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

#define PLUGIN "Music"
#define VERSION "1.0"
#define AUTHOR "sToP !"


public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    return PLUGIN_CONTINUE
}

public plugin_precache()
{
    precache_generic("media/Half-Life16.mp3")
    return PLUGIN_CONTINUE
}

public client_connect(id)
{
    client_cmd(id,"mp3 play media/Half-Life16.mp3")
    return PLUGIN_CONTINUE
}

public client_putinserver(id)
{
    set_task(5.0, "stop_song", id)
    return PLUGIN_CONTINUE
}

public stop_song(id)
{
    client_cmd(id,"mp3 stop")
    return PLUGIN_HANDLED
}
Reply


Messages In This Thread
Loading Music - by marcudaniel1337 - 07-29-2024, 07:01 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)