PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <colorchat>
#define PLUGIN "Talk"
#define VERSION "1"
#define AUTHOR "Thew_ConFIger"
#define ACCESS ADMIN_CVAR
new g_pCvarchname
new g_pCvarNoSay
new block
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_pCvarchname = register_cvar("sv_noname", "0")
register_forward(FM_ClientUserInfoChanged, "ClientUserInfoChanged")
register_clcmd("say /t0","talk",ACCESS)
register_clcmd("say /t1","ontalk",ACCESS)
register_clcmd("say /t2","offtalk",ACCESS)
}
public talk(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
server_cmd("sv_alltalk 0");
ColorChat(0, BLUE,"%s: /t0",name)
}
return PLUGIN_HANDLED
}
public ontalk(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
server_cmd("sv_alltalk 1");
ColorChat(0, BLUE,"%s: /t1",name)
}
return PLUGIN_HANDLED
}
public offtalk(id, level, cid)
{
if(cmd_access(id,level, cid, 1))
{
new name[32]
get_user_info(id, "name", name, 31)
server_cmd("sv_alltalk 2");
ColorChat(0, BLUE,"%s: /t2",name)
}
return PLUGIN_HANDLED
}