07-29-2024, 07:01 PM
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
}