廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 1366 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
坏蛋
個人文章 個人相簿 個人日記 個人地圖
路人甲
級別: 路人甲 該用戶目前不上站
推文 x0 鮮花 x2
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[1.6][插件] 大家来看看这插件怎么用。。。。。
这是一中文ID插件。
据发布者说:本插件直接使用AXOT的DLL功能进行修改,可以随意更换名字(也就是说被系统改名后你还可以改其他名,锁定名字功能我删除了)    求使用方式。。那个“直接使用AXOT的DLL功能进行修改”这个是什么意思??我找了很久。才找到这种插件。有没人解释下改怎么用???
以下是插件源码

#include <amxmodx>
#include <fakemeta>
#define PLUGIN "UTF-8 name"
#define VERSION "0.01"
#define AUTHOR "nooby"

//自动换名最大人数
#define MAX_NAMES 10240
#define ACCESS ADMIN_RESERVATION
new p_access
new p_autoname
new g_newname[33][32]
new g_total
new namelist[MAX_NAMES][2][32]
new bool:putinsvr[33]
public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
        p_access = register_cvar("u_needaccess", "1")
        p_autoname = register_cvar("u_autoname", "1")
}
public plugin_cfg()
        set_task(2.2, "read_namelist")
stock check_namelist(id)
{
        new name[32]
        get_user_name(id, name, 31)
        for (new i = 0; i < g_total; i++)
        {
                if (equali(namelist[0], name))
                {
                        copy(g_newname[id], 31, namelist[1])
                        set_task(5.0, "rename_task", 1132 + id, _, _, "b")
                       
                        return PLUGIN_CONTINUE
                }
        }
        return PLUGIN_CONTINUE
}
public rename_task(tid)
{
        static id
        id = tid - 1132
        //client_print(id,print_chat,"Start change")
        if (is_user_alive(id))
        {
                rename(id)
                remove_task(tid)
        }
        if (!is_user_connected(id) && !is_user_connecting(id))
                remove_task(tid)
}
public client_putinserver(id)
{
        putinsvr[id] = true
        if (get_pcvar_num(p_autoname) && (get_pcvar_num(p_access) ? (get_user_flags(id) & ACCESS) : 1))
                check_namelist(id)
        return PLUGIN_CONTINUE
}
public read_namelist()
{
        if (!get_pcvar_num(p_autoname))
        {
                return
        }
        g_total = 0
        new data_dir[128]
        new data_file[128]
        get_localinfo("amxx_datadir", data_dir, 127)
        formatex(data_file, 127, "%s/names_utf8.txt", data_dir)
        if (!file_exists(data_file))
        {
                log_amx("Error: can not find names_utf8.txt in data folder.")
                return
        }
        new text[32]
        new line, textlen
        new bool:is_chsname
       
        if (!read_file(data_file ,line++, text, 31, textlen))
        {
                log_amx("names_utf8.txt is empty.")
                return
        }
        else
        {
                if (textlen > 3 && text[0] == -17 && text[1] == -69 && text[2] == -65)//BOM
                {
                        copy(text, 31,text[3])
                }
                trim(text)
                if (!(strlen(text) == 0 || text[0] == '/' && text[1] == '/' || text[0] == ';'))
                {
                        copy(namelist[g_total][0], 31,text)
                        is_chsname = true
                }
        }
       
        while (read_file(data_file, line++, text, 31, textlen))
        {
                trim(text)
                if (!(strlen(text) == 0 || text[0] == '/' && text[1] == '/' || text[0] == ';'))
                {
                        if (g_total > MAX_NAMES)
                        {
                                log_amx("Loaded %d name(s). All the rest are ignored.", g_total)
                                return
                        }
                        if (!is_chsname)
                        {
                                copy(namelist[g_total][0], 31,text)
                                is_chsname = true
                        }
                        else
                        {
                                copy(namelist[g_total++][1], 31,text)
                                is_chsname = false
                        }
                }
        }
        log_amx("Loaded %d name(s)", g_total)
}

public client_disconnect (id)
{
        putinsvr[id] = false
        if (task_exists(1132 + id))
        {
                remove_task(1132 + id)
        }
}
public rename(id)
{
        //client_print(id,print_chat,"UserInfo: %s",g_newname[id])
        set_user_info(id, "name", g_newname[id])
}



獻花 x0 回到頂端 [樓 主] From:廣東 | Posted:2010-11-05 21:00 |
i-c0112
個人頭像
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x6 鮮花 x194
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

//直接放程式碼很亂,請善用[code]語法

應該是在你的 amxmodx\data\names_utf8.txt 修改名字
應該是這樣:

abcdefg //英文名
中文名字1 //對應的中文名

hijklmn
中文名字2
stock check_namelist(id)
{
      new name[32]
      get_user_name(id, name, 31)
      for (new i = 0; i < g_total; i++)
      {
          //這邊的內容也該改一下
          if (equali(namelist[ i ][0], name))
          {
                copy(g_newname[id], 31, namelist[ i ][1])
                set_task(5.0, "rename_task", 1132 + id, _, _, "b")
               
                return PLUGIN_CONTINUE
          }
      }
      return PLUGIN_CONTINUE
}


獻花 x0 回到頂端 [1 樓] From:台灣中華電信 | Posted:2010-11-05 21:54 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.019648 second(s),query:16 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言