qzdisk 发表于 2008-9-10 04:24:09

哪位能帮我汉化汉化代码


#include <amxmodx>
#include <amxmisc>
/* Player Menus */
#define MAX_MENU_NUM 24
new g_MenuName[ MAX_MENU_NUM ]
new g_MenuCmd[ MAX_MENU_NUM ]
new PMenuName[] = "Player Menu"
new g_MenuItem[] = {
"More",
"Back",
"Exit"
}
new g_cNum
new g_menuPosition
public plugin_init() {
register_plugin("Player Menu","0.1","nwb13")
register_menucmd(register_menuid( PMenuName ),1023,"actionPlMenu")
register_clcmd("say menu","PlMenu",ADMIN_ALL, "display player menu" )
new configs
get_configsdir(configs, 63)
format(configs, 63, "%s/%s", configs, "plmenu.ini")
loadSettings(configs)
}
loadSettings(plmenuconfig[]) {
if (!file_exists(plmenuconfig))
return 0
new temp
new a, pos = 0
while ( g_cNum < MAX_MENU_NUM && read_file(plmenuconfig,pos++,temp,255,a) ) {      
if ( temp == ';' )
continue
if (parse(temp,g_MenuName,31,g_MenuCmd,31) < 2)
continue
++g_cNum
}
return 1
}
public PlMenu(id){
if (is_user_connected(id))
disPlayerMenu(id,g_menuPosition = 0)
return PLUGIN_HANDLED
}
disPlayerMenu(id,pos) {
if (pos < 0)return
new menuBody
new b = 0
new start = pos * 8
if (start >= g_cNum )
start = pos = g_menuPosition = 0
new len = format(menuBody,511,"\y%s\R%d/%d^n\w^n",PMenuName,pos+1,( g_cNum / 8 + ((g_cNum % 8) ? 1 : 0 )) )
new end = start + 8
new keys = MENU_KEY_0
if (end > g_cNum )
end = g_cNum
for (new a = start; a < end; ++a) {
keys |= (1<<b)
len += format(menuBody,511-len,"%d. %s^n",++b,g_MenuName)
}
if (end != g_cNum ) {
      format(menuBody,511-len,"^n9. %s...^n0. %s", g_MenuItem, pos ? g_MenuItem : g_MenuItem)
keys |= MENU_KEY_9
}
else format(menuBody,511-len,"^n0. %s",pos ? g_MenuItem : g_MenuItem)
show_menu(id,keys,menuBody,-1,PMenuName)
}
public actionPlMenu(id,key){
switch(key){
case 8:{
   disPlayerMenu(id,++g_menuPosition)
}
case 9:{
   disPlayerMenu(id,--g_menuPosition)
}
default:{
   new menuitem = g_menuPosition * 8 + key
   client_cmd(id,"%s",g_MenuCmd)
}
}
return PLUGIN_HANDLED
}


哪位能帮我汉化汉化这段代码!

qzdisk 发表于 2008-9-10 04:44:04

回复: 哪位能帮我汉化汉化代码

new PMenuName[] = "Player Menu"
new g_MenuItem[] = {
"More",
"Back",
"Exit"

这部分我起初写成中文编译出来就是乱码!不懂AMXX的语法规则!

tingshow163 发表于 2009-7-5 19:40:06

这个是玩家菜单的插件,你只需要在config里面的plmenu.ini里修改就可以了#include <amxmodx>
#include <amxmisc>
/* Player Menus */
#define MAX_MENU_NUM 24
new g_MenuName[ MAX_MENU_NUM ]
new g_MenuCmd[ MAX_MENU_NUM ]
new PMenuName[] = "玩家菜单"
new g_MenuItem[] = {
"下页",
"上页",
"退出"
}
new g_cNum
new g_menuPosition
public plugin_init() {
register_plugin("Player Menu","0.1","nwb13")
register_menucmd(register_menuid( PMenuName ),1023,"actionPlMenu")
register_clcmd("say menu","PlMenu",ADMIN_ALL, "display player menu" )
new configs
get_configsdir(configs, 63)
format(configs, 63, "%s/%s", configs, "plmenu.ini")
loadSettings(configs)
}
loadSettings(plmenuconfig[]) {
if (!file_exists(plmenuconfig))
return 0
new temp
new a, pos = 0
while ( g_cNum < MAX_MENU_NUM && read_file(plmenuconfig,pos++,temp,255,a) ) {      
if ( temp == ';' )
continue
if (parse(temp,g_MenuName,31,g_MenuCmd,31) < 2)
continue
++g_cNum
}
return 1
}
public PlMenu(id){
if (is_user_connected(id))
disPlayerMenu(id,g_menuPosition = 0)
return PLUGIN_HANDLED
}
disPlayerMenu(id,pos) {
if (pos < 0)return
new menuBody
new b = 0
new start = pos * 8
if (start >= g_cNum )
start = pos = g_menuPosition = 0
new len = format(menuBody,511,"\y%s\R%d/%d^n\w^n",PMenuName,pos+1,( g_cNum / 8 + ((g_cNum % 8) ? 1 : 0 )) )
new end = start + 8
new keys = MENU_KEY_0
if (end > g_cNum )
end = g_cNum
for (new a = start; a < end; ++a) {
keys |= (1<<b)
len += format(menuBody,511-len,"%d. %s^n",++b,g_MenuName)
}
if (end != g_cNum ) {
      format(menuBody,511-len,"^n9. %s...^n0. %s", g_MenuItem, pos ? g_MenuItem : g_MenuItem)
keys |= MENU_KEY_9
}
else format(menuBody,511-len,"^n0. %s",pos ? g_MenuItem : g_MenuItem)
show_menu(id,keys,menuBody,-1,PMenuName)
}
public actionPlMenu(id,key){
switch(key){
case 8:{
   disPlayerMenu(id,++g_menuPosition)
}
case 9:{
   disPlayerMenu(id,--g_menuPosition)
}
default:{
   new menuitem = g_menuPosition * 8 + key
   client_cmd(id,"%s",g_MenuCmd)
}
}
return PLUGIN_HANDLED
}
页: [1]
查看完整版本: 哪位能帮我汉化汉化代码