求助 amxx插件高手 帮我看下插件哪出了问题 谢谢 !~
求助 amxx插件高手 帮我看下插件哪出了问题 谢谢 !~scripting.rar (2.23 KB) 下载次数: 0
刚才
VIP 说话 前面 加(OP) 是CS1.5 谢谢各位 帮帮
开始挺好的 但是 到了后面玩家(大概 10几分钟后)就按 Y打不了字了
求救啊有哪位高手 看下 帮忙改下 !
VIPshuohua.txt
COL_WHITE = white
COL_RED = red
COL_GREEN = green
COL_BLUE = blue
COL_YELLOW = yellow
COL_MAGENTA = magenta
COL_CYAN = cyan
COL_ORANGE = orange
COL_OCEAN = ocean
COL_MAROON = maroon
PRINT_ALL = (ALL) %s : %s
COL_WHITE = bai se
COL_RED = hong se
COL_GREEN = lv se
COL_BLUE = lan se
COL_YELLOW = huang se
COL_MAGENTA = yang hong
COL_CYAN = qing se
COL_ORANGE = cheng se
COL_OCEAN = hai lan
COL_MAROON = li se
PRINT_ALL = %s : %s
收藏 分享 评分 sma 代码如下
#include <amxmodx>
#include <amxmisc>
new g_msgChannel
#define MAX_CLR 10
new g_Colors[] = {"COL_WHITE", "COL_RED", "COL_GREEN", "COL_BLUE", "COL_YELLOW", "COL_MAGENTA", "COL_CYAN", "COL_ORANGE", "COL_OCEAN", "COL_MAROON"}
new g_Values[] = {{255, 255, 255}, {255, 0, 0}, {0, 255, 0}, {0, 0, 255}, {255, 255, 0}, {255, 0, 255}, {0, 255, 255}, {227, 96, 8}, {45, 89, 116}, {103, 44, 38}}
new Float:g_Pos[] = {{0.0, 0.0}, {0.05, 0.55}, {-1.0, 0.2}, {-1.0, 0.7}}
new amx_show_activity;
new g_AdminChatFlag = ADMIN_CHAT;
public plugin_init()
{
new admin_chat_id
register_plugin("Admin Chat", AMXX_VERSION_STR, "AMXX Dev Team")
register_dictionary("VIPshuohua.txt")
register_clcmd("say", "cmdSayChat", ADMIN_CHAT, "@[@|@|@]<text> - displays hud message")
register_concmd("say", "cmdSay", ADMIN_CHAT, "<message> - sends message to all players")
amx_show_activity = get_cvar_pointer("amx_show_activity");
if (amx_show_activity == 0)
{
amx_show_activity = register_cvar("amx_show_activity", "2");
}
new str
get_concmd(admin_chat_id, str, 0, g_AdminChatFlag, str, 0, -1)
}
public cmdSayChat(id)
{
if (!access(id, g_AdminChatFlag))
{
return PLUGIN_CONTINUE
}
new said, i = 0
read_argv(1, said, 5)
while (said == '@')
{
i++
}
if (!i || i > 3)
{
return PLUGIN_CONTINUE
}
new message, a = 0
read_args(message, 191)
remove_quotes(message)
switch (said)
{
case 'r': a = 1
case 'g': a = 2
case 'b': a = 3
case 'y': a = 4
case 'm': a = 5
case 'c': a = 6
case 'o': a = 7
}
new n, s = i
if (a)
{
n++
s++
}
while (said && isspace(said))
{
n++
s++
}
new name, authid, userid
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)
log_amx("Chat: ^"%s<%d><%s><>^" tsay ^"%s^"", name, userid, authid, message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_tsay^" (text ^"%s^") (color ^"%L^")", name, userid, authid, message, "en", g_Colors)
if (++g_msgChannel > 6 || g_msgChannel < 3)
{
g_msgChannel = 3
}
new Float:verpos = g_Pos + float(g_msgChannel) / 35.0
set_hudmessage(g_Values, g_Values, g_Values, g_Pos, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)
switch ( get_pcvar_num(amx_show_activity) )
{
case 3, 4:
{
new maxpl = get_maxplayers();
for (new pl = 1; pl <= maxpl; pl++)
{
if (is_user_connected(pl) && !is_user_bot(pl))
{
if (is_user_admin(pl))
{
show_hudmessage(pl, "%s : %s", name, message)
client_print(pl, print_notify, "%s : %s", name, message)
}
else
{
show_hudmessage(pl, "%s", message)
client_print(pl, print_notify, "%s", message)
}
}
}
}
case 2:
{
show_hudmessage(0, "%s : %s", name, message)
client_print(0, print_notify, "%s : %s", name, message)
}
default:
{
show_hudmessage(0, "%s", message)
client_print(0, print_notify, "%s", message)
}
}
return PLUGIN_HANDLED
}
public cmdSayAdmin(id)
{
new said
read_argv(1, said, 1)
if (said != '@')
return PLUGIN_CONTINUE
new message, name, authid, userid
new players, inum
read_args(message, 191)
remove_quotes(message)
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)
log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message)
if (is_user_admin(id))
format(message, 191, "(%L) %s :%s", id, "ADMIN", name, message)
else
format(message, 191, "(%L) %s :%s", id, "PLAYER", name, message)
get_players(players, inum)
for (new i = 0; i < inum; ++i)
{
// dont print the message to the client that used the cmd if he has ADMIN_CHAT to avoid double printing
if (players != id && get_user_flags(players) & g_AdminChatFlag)
client_print(players, print_chat, "%s", message)
}
client_print(id, print_chat, "%s", message)
return PLUGIN_HANDLED
}
public cmdChat(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new message, name, players, inum, authid, userid
read_args(message, 191)
remove_quotes(message)
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)
get_players(players, inum)
log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message)
format(message, 191, "(ADMINS) %s : %s", name, message)
console_print(id, "%s", message)
for (new i = 0; i < inum; ++i)
{
if (access(players, g_AdminChatFlag))
client_print(players, print_chat, "%s", message)
}
return PLUGIN_HANDLED
}
public cmdSay(id, level, cid)
{
if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED
new message, name, authid, userid
read_args(message, 191)
remove_quotes(message)
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)
client_print(0, print_chat, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
console_print(id, "%L", LANG_PLAYER, "PRINT_ALL", name, message)
log_amx("Chat: ^"%s<%d><%s><>^" say ^"%s^"", name, userid, authid, message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_vip^" (text ^"%s^")", name, userid, authid, message)
return PLUGIN_HANDLED
}
public cmdPsay(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new name
read_argv(1, name, 31)
new priv = cmd_target(id, name, 0)
if (!priv)
return PLUGIN_HANDLED
new length = strlen(name) + 1
get_user_name(priv, name, 31);
new message, name2, authid, authid2, userid, userid2
get_user_authid(id, authid, 31)
get_user_name(id, name2, 31)
userid = get_user_userid(id)
read_args(message, 191)
if (message == '"' && message == '"') // HLSW fix
{
message = ' '
message = ' '
length += 2
}
remove_quotes(message)
get_user_name(priv, name, 31)
if (id && id != priv)
client_print(id, print_chat, "(%s) %s : %s", name, name2, message)
client_print(priv, print_chat, "(%s) %s : %s", name, name2, message)
console_print(id, "(%s) %s : %s", name, name2, message)
get_user_authid(priv, authid2, 31)
userid2 = get_user_userid(priv)
log_amx("Chat: ^"%s<%d><%s><>^" psay ^"%s<%d><%s><>^" ^"%s^"", name2, userid, authid, name, userid2, authid2, message)
log_message("^"%s<%d><%s><>^" triggered ^"amx_psay^" against ^"%s<%d><%s><>^" (text ^"%s^")", name2, userid, authid, name, userid2, authid2, message)
return PLUGIN_HANDLED
}
public cmdTsay(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new cmd, color, color2, message, name, authid, userid = 0
read_argv(0, cmd, 15)
new bool:tsay = (tolower(cmd) == 't')
read_args(message, 191)
remove_quotes(message)
parse(message, color, 15)
new found = 0, a = 0
new lang, langnum = get_langsnum()
for (new i = 0; i < MAX_CLR; ++i)
{
for (new j = 0; j < langnum; j++)
{
get_lang(j, lang)
format(color2, 15, "%L", lang, g_Colors)
if (equali(color, color2))
{
a = i
found = 1
break
}
}
if (found == 1)
break
}
new length = found ? (strlen(color) + 1) : 0
if (++g_msgChannel > 6 || g_msgChannel < 3)
g_msgChannel = 3
new Float:verpos = (tsay ? 0.55 : 0.1) + float(g_msgChannel) / 35.0
get_user_authid(id, authid, 31)
get_user_name(id, name, 31)
userid = get_user_userid(id)
set_hudmessage(g_Values, g_Values, g_Values, tsay ? 0.05 : -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)
switch ( get_pcvar_num(amx_show_activity) )
{
case 3, 4:
{
new maxpl = get_maxplayers();
for (new pl = 1; pl <= maxpl; pl++)
{
if (is_user_connected(pl) && !is_user_bot(pl))
{
if (is_user_admin(pl))
{
show_hudmessage(pl, "%s : %s", name, message)
client_print(pl, print_notify, "%s : %s", name, message)
}
else
{
show_hudmessage(pl, "%s", message)
client_print(pl, print_notify, "%s", message)
}
}
}
console_print(id, "%s :%s", name, message)
}
case 2:
{
show_hudmessage(0, "%s : %s", name, message)
client_print(0, print_notify, "%s : %s", name, message)
console_print(id, "%s :%s", name, message)
}
default:
{
show_hudmessage(0, "%s", message)
client_print(0, print_notify, "%s", message)
console_print(id, "%s", message)
}
}
log_amx("Chat: ^"%s<%d><%s><>^" %s ^"%s^"", name, userid, authid, cmd, message)
log_message("^"%s<%d><%s><>^" triggered ^"%s^" (text ^"%s^") (color ^"%s^")", name, userid, authid, cmd, message, color2)
return PLUGIN_HANDLED
} 自己先顶 麻烦 会的朋友帮忙看下!
页:
[1]