Osker Lee 发表于 2011-9-14 21:38:10

怎么改成DOD也可以使用的插件?

本帖最后由 Osker Lee 于 2011-9-14 21:42 编辑

这里有个玩家名字前缀战队标签的插件,就是可以在CT和T双方的玩家名字前分别加上其专属的战队名称。这个插件在CS里可以使用,有人知道怎么改成DOD也可以使用的插件吗?
#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);
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
}
页: [1]
查看完整版本: 怎么改成DOD也可以使用的插件?