坏蛋
|
分享:
▼
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]) }
|