Forum
Connect/Disconnect sounds - Printable Version

+- Forum (https://dm20.net/forum)
+-- Forum: Scripting (https://dm20.net/forum/forumdisplay.php?fid=5)
+--- Forum: Showcase (https://dm20.net/forum/forumdisplay.php?fid=6)
+--- Thread: Connect/Disconnect sounds (/showthread.php?tid=9)



Connect/Disconnect sounds - marcudaniel1337 - 07-28-2024

This plugin plays a sound on player connect and a sound on player disconnect.

Code:
#include <amxmodx>

#define    PLUGIN    "Connect Sound"
#define    VERSION    "1.0"
#define    AUTHOR    "sToP !"

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

public plugin_precache()
{
    precache_sound("buttons/bell1.wav");
    precache_sound("barney/seeya.wav");
}
public client_putinserver()
{
    client_cmd(0, "spk buttons/bell1.wav");
    return PLUGIN_CONTINUE;
}
public client_disconnect()
{
    client_cmd(0, "spk barney/seeya.wav");
    return PLUGIN_CONTINUE;
}