|
本帖最后由 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[16]
- read_data(2,team,15)
- AddTag(id,team)
- }
- public AddTag(id,team[])
- {
- new temp[6],name[32],tag[32]
- get_user_info(id,"name",name,31)
- copy(temp,5,name)
- if(equali(team,"CT"))
- {
- if(equal(temp,"[CHM]"))
- {
- return;
- }else if(contain(temp,"[MOD]")!=-1){
- copy(temp,5,name);
- if(equal(temp,"[MOD]"))
- format(tag,31,"[CHM] %s",name[6])
- }else{
- format(tag,31,"[CHM] %s",name)
- }
- set_user_info(id,"name",tag)
- }
- if(equali(team,"TERRORIST"))
- {
- if(equal(temp,"[CHM]"))
- {
- format(tag,31,"[MOD] %s",name[6])
- }else if(contain(temp,"[MOD]")!=-1)
- {
- copy(temp,5,name)
- if(equal(temp,"[MOD]"))
- return;
- }else{
- format(tag,31,"[MOD] %s",name);
- }
- set_user_info(id,"name",tag)
- }
- }
- public client_infochanged(id)
- {
- if(!is_user_connected(id))
- return PLUGIN_CONTINUE
- new oldname[32],newname[32],team[16]
- 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
- }
-
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|