【求助】menu文字显示问题 !
如图,请问该如何才能显示正常呢?如何才能取消掉ML_NOTFOUND前缀儿呢?所使用的插件为saymenu.sma 使用的lang文件为common.txt saymenu.txt
附件为以上3各插件的打包。
saymenu代码 ,代码部分自行删除了菜单项目,并#define MENUS_NUMBER 改为3。这样该不知道是否合理 !红色部分
=====================
/* AMX Mod X
*
* (c) Copyright 2004, datang
*
* This file is part of AMX Mod X.
*
*/
#include <amxmodx>
#include <amxmisc>
new g_menuPosition
#define MENUS_NUMBER 3
new g_menuBody[] = {
"ADMIN_MENU",
"Vote KICK",
"Vote BAN"
// Next Page
}
new g_menuCmd[] = {
"amxmodmenu",
"amx_votekickmenu",
"amx_votebanmenu"
// Next Page
}
new g_coloredMenus
public plugin_init() {
register_plugin("saymenu","1.0","datang")
register_dictionary("saymenu.txt")
register_dictionary("common.txt")
register_menucmd(register_menuid("USER MENU"),1023,"actionMenu")
register_clcmd("say menu", "saymenu",0,"- displays user menu")
g_coloredMenus = colored_menus()
}
public actionMenu(id,key) {
switch (key) {
case 8: displayMenu(id,++g_menuPosition)
case 9: displayMenu(id,--g_menuPosition)
default: client_cmd(id, g_menuCmd[ g_menuPosition * 8 + key ] )
}
return PLUGIN_HANDLED
}
displayMenu(id,pos) {
if (pos < 0)return
new menuBody
new b = 0
new start = pos * 8
if ( start >= MENUS_NUMBER )
start = pos = g_menuPosition = 0
new len = format(menuBody,511, g_coloredMenus ? "\yUSER MENU\R%d/%d^n\w^n" : "USER MENU %d/%d^n^n" , pos+1, 2 )
new end = start + 8
new keys = MENU_KEY_0
if (end > MENUS_NUMBER )
end = MENUS_NUMBER
for (new a = start; a < end; ++a) {
keys |= (1<<b)
len += format(menuBody,511-len,"%d. %L^n",++b, id, g_menuBody[ a ] )
}
if (end != MENUS_NUMBER ) {
format(menuBody,511-len,"^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
keys |= MENU_KEY_9
}
else format(menuBody,511-len,"^n0. %L", id, pos ? "BACK" : "EXIT")
show_menu(id,keys,menuBody)
}
public saymenu(id,level,cid) {
displayMenu(id,g_menuPosition = 0)
return PLUGIN_HANDLED
}
====================================
红色部分的源代码
#define MENUS_NUMBER 8
new g_menuBody[] = {
"ADMIN_MENU",
"THE_TIME",
"TIME_LEFT",
"NEXT_MAP",
"SAY_RANKSTATS",
"SAY_STATSME",
"SAY_STATS",
"SAY_TOP15"
// Next Page
}
new g_menuCmd[] = {
"amxmodmenu",
"say thetime",
"say timeleft",
"say nextmap",
"say /rankstats",
"say /statsme",
"say /stats",
"say /top15"
// Next Page
}
回复: 【求助】menu文字显示问题 !
好像不关代码的事吧,你custommenuitems文本是怎么写的回复: 【求助】menu文字显示问题 !
Post by AE86好像不关代码的事吧,你文本是怎么写的
我没用amxx1.55自带的saymenu插件,用的是上面写的插件。因此,custommenuitems文本里什么都没写,为空。
amxx1.55自带的saymenu有点不好,比如管理员输入say menu只能看到amxmodmenu的菜单,无法看到amx_menu的菜单。虽然可以用其他方法打开amx_menu菜单,但是总觉得有些麻烦。
上图使用的saymenu就比较好,admin和client的菜单可同时显示。方便了管理员进行直接kick/ban和votekick/voteban,而且对于普通用户自动被屏蔽掉admins菜单。
回复: 【求助】menu文字显示问题 !
看不懂ing~~~~~~~~~~~ 能否加个解封ip的代码呢? 我知道怎么改.把代码说明加到common里面就行了
页:
[1]