#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "k1nader"
static const g_nosXeIname[] = "[NO-sXe-I]";
new g_iSayTextBlock[33], g_iUserIsUsesXeClient[33];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_message(get_user_msgid("SayText"), "Message_SayText");
}
public client_putinserver(id)
{
g_iSayTextBlock[id] = 0;
g_iUserIsUsesXeClient[id] = 1;
}
public Message_SayText(dest, type, id)
{
static msg[128];
get_msg_arg_string(2, msg, charsmax(msg));
if (equal(msg, "#Cstrike_Name_Change"))
{
static name[32], PlayerId;
PlayerId = get_msg_arg_int(1);
if (!g_iSayTextBlock[PlayerId])
{
get_msg_arg_string(4, name, charsmax(name));
if(contain(name, g_nosXeIname) != -1)
{
replace_all(name, charsmax(name), g_nosXeIname, "");
set_user_info(PlayerId, "name", name);
g_iSayTextBlock[PlayerId] = 1;
g_iUserIsUsesXeClient[PlayerId] = 0;
return PLUGIN_HANDLED;
}
}
else
{
g_iSayTextBlock[PlayerId] = 0;
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
stock sXeClient(id)
{
return g_iUserIsUsesXeClient[id];
}
我用这个测试了下,可以通过。 |