引用 | 编辑
不想再想名字
2014-05-12 11:31 |
楼主
▼ |
||
![]() 试过用下面这个, 也用了UTF-8保存, 好像没有效果 复制程式 new const name[] = "你好吗"; if(equal(name, "你好吗")) { xxxxxxxxxxxx } ![]()
|
引用 | 编辑
弑血
2014-05-12 13:54 |
1楼
▲ ▼ |
下面是引用 不想再想名字 于 2014-05-12 11:31 发表的 请各位帮忙插件问题: 你是要取得相对应玩家名称来触发事件吗 可以使用 new iname[32]; get_user_name(id, iname, charsmax(iname)); if (equal(iname, "xxx")) /xxx 你想要的玩家称昵.. { xxxxxxx //执行的动作. } 如果判断事件无法触发,可能要放在玩家思考内,最好用开关判定 ![]() |
引用 | 编辑
不想再想名字
2014-05-12 14:35 |
3楼
▲ ▼ |
下面是引用 s8720419 于 2014-05-12 13:54 发表的 : 感谢你的回答, 但其实我想试一下能不能用equal来对应中文字 因为我用了write_file保存资料 在read_file时会获得中文字并进行equal(file的中文字, sma的变数) 但好像都是return false ![]() |
引用 | 编辑
不想再想名字
2014-05-12 17:56 |
7楼
▲ |
下面是引用 s8720419 于 2014-05-12 17:27 发表的 : 复制程式 #include <amxmodx> new const player_data[][] = { "等级", "经验" }; new const file[] = { "addons/amxmodx/configs/test/test.ini" }; public plugin_init() { register_plugin("Testing", "1.0", "Test"); register_clcmd("say /t", "test"); } public test(id) { new left[32], text[64], line, txtlen; while(read_file(file, line++, text, charsmax(text), txtlen)) { strtok(text, left, charsmax(left), text, charsmax(text), ' '); for(new t = 0; t < sizeof(player_data); t++) { client_print(id, print_chat, "|%s|%s|", left, player_data[t]); if(equal(left, player_data[t])) { client_print(id, print_chat, "Work"); break; } } } } ![]() |