【求助】玩家名字前面加队标
本帖最后由 lili2009 于 2012-5-22 18:01 编辑http://6c.images22.51img1.com/6000/lili94dj/cc0103de0d95124cbc6be7cd2614138c.png470998550请插件编写高手看下图: 默认队标是如果玩家也带有这个队标名字进入服务器的话。是不会在执行的,会自动检测是否存在这个队标名字了,建立1个immune_names.txt到amxmodx\configs目录,immune_names.txt是排除不需要设置队标的玩家名字从上到下的写
例子
name1
name2
name3
name4 如何判断加什么样的队标呢?根据权限还是 看不到啊!太悲剧了! 可以有权限,但最好普通玩家也可以,挂上队标!hackroad 同志你会为广大cs儿,写这个插件吗?
大家和我同样在期待中......... 为什么我人伸出援手呢! 貌似 好像 我有一个但没代码 无用啊 你自己都表述不清楚,人家问你加什么的队标,什么条件下加 上一楼的朋友你好,其实,这个插件的源码我有的。就是编辑出有乱码。
本帖最后由 lili2009 于 2012-6-3 23:39 编辑
http://b223.photo.store.qq.com/psb?/V116GVVY2UKTyD/ve.SQh6z0kXUNNPYRkm3AwpCqPYOzerzKYF*n1jSszc!/b/YVAn7oRzIgAAYkPi.IT*IgAA请高手看下!哪里出错。
#include <amxmodx>
#include <amxmisc>
#define PLUGIN_NAME "Flag Name"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "zwfgdlc"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
server_cmd("mp_limitteams 1")
register_event("TeamInfo","join_team","a","2!UNASSIGNED","2!SPECTATOR")
}
public join_team()
{
new id=read_data(1)
new team
read_data(2,team,15)
AddTag(id,team)
}
public AddTag(id,team[])
{
new temp,name,tag
get_user_info(id,"name",name,31)
copy(temp,5,name)
if(equali(team,"CT"))
{
if(equal(temp,""))
{
return;
}else if(contain(temp,"")!=-1){
copy(temp,5,name);
if(equal(temp,""))
format(tag,31," %s",name)
}else{
format(tag,31," %s",name)
}
set_user_info(id,"name",tag)
}
if(equali(team,"TERRORIST"))
{
if(equal(temp,""))
{
format(tag,31," %s",name)
}else if(contain(temp,"")!=-1)
{
copy(temp,5,name)
if(equal(temp,""))
return;
}else{
format(tag,31," %s",name);
}
set_user_info(id,"name",tag)
}
}
public client_infochanged(id)
{
if(!is_user_connected(id))
return PLUGIN_CONTINUE
new oldname,newname,team
get_user_name(id,oldname,31)
get_user_info(id,"name",newname,31)
if(!equal(oldname,newname))
{
get_user_team(id,team,15);
if(!is_user_alive(id))
{
message_begin(MSG_BROADCAST, get_user_msgid("SayText"))
write_byte(id)
write_string("#Cstrike_Name_Change")
write_string(oldname)
write_string(newname)
message_end()
}
}
AddTag(id,team)
return PLUGIN_CONTINUE
}