rgm4 发表于 2008-5-31 00:16:55

谁能帮我修改一下,谢谢了

#include <amxmod>

public plugin_init()
{
register_clcmd( "say /servers","ShowMenu", -1, "Shows The menu" )
register_menucmd(register_menuid("\y服务器传送:"), 1023, "MenuCommand" )
return PLUGIN_CONTINUE
}
public ShowMenu( id )
{
new szMenuBody
new keys
new nLen = format( szMenuBody, 255, "\y选择服务器:^n" )
nLen += format( szMenuBody, 255-nLen, "^n\w1. CHIN@HZ|More混战1号服【sXe】" )
nLen += format( szMenuBody, 255-nLen, "^n\w2. CHIN@HZ|More混战2号服【sXe】" )
nLen += format( szMenuBody, 255-nLen, "^n^n\w0. 退出" )
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
show_menu( id, keys, szMenuBody, -1 )
return PLUGIN_CONTINUE
}
public MenuCommand( id, key )
{
client_print( id, print_console, " Key=%d", key )
client_print( id, print_chat, " Key=%d", key )
switch( key )
{
case 0: client_cmd( id, "connect rgm4.vicp.net:27015" )
case 1: client_cmd( id, "connect rgm4.vicp.net:27016" )
case 9: client_print( id, print_chat, "菜单操作退出" )
}
return PLUGIN_HANDLED
}

rgm4 发表于 2008-5-31 00:19:10

回复: 谁能帮我修改一下,谢谢了

菜单是显示了,但不能执行connect rgm4.vicp.net:XXX请高手看看哪里错了,谢谢了

Cr@zyTreE 发表于 2008-5-31 01:07:52

回复: 谁能帮我修改一下,谢谢了

Post by rgm4
菜单是显示了,但不能执行connect rgm4.vicp.net:XXX请高手看看哪里错了,谢谢了

你的rgm4.vicp.net解析有问题。

你自己在控制台输入connect rgm4.vicp.net:27016看看能否连接。

zhangsheng 发表于 2008-5-31 01:14:29

回复: 谁能帮我修改一下,谢谢了

眼睛瞎了啊注册那么多KEY.你能按得动才是见鬼了
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)

wangyang5008 发表于 2008-5-31 01:19:47

回复: 谁能帮我修改一下,谢谢了

哈哈!是没长眼睛啊。做人还是厚道点好!

leiminlm 发表于 2008-5-31 02:41:33

回复: 谁能帮我修改一下,谢谢了

请看此贴3楼的回复,也行有帮助

Rulzy 发表于 2008-5-31 12:49:53

回复: 谁能帮我修改一下,谢谢了

#include <amxmod>
public plugin_init()
{
register_clcmd( "say /servers","ShowMenu", -1, "Shows The menu" )
register_menucmd(register_menuid("\y选择服务器:"), 1023, "MenuCommand" )
return PLUGIN_CONTINUE
}
public ShowMenu( id )
{
new szMenuBody
new keys
new nLen = format( szMenuBody, 255, "\y选择服务器:^n" )
nLen += format( szMenuBody, 255-nLen, "^n\w1. CHIN@HZ|More混战1号服【sXe】" )
nLen += format( szMenuBody, 255-nLen, "^n\w2. CHIN@HZ|More混战2号服【sXe】" )
nLen += format( szMenuBody, 255-nLen, "^n^n\w0. 退出" )
keys = (1<<0) | (1<<1) | (1<<9);
show_menu( id, keys, szMenuBody, -1 , "Change Server")
return PLUGIN_CONTINUE
}
public MenuCommand( id, key )
{
client_print( id, print_console, " Key=%d", key )
client_print( id, print_chat, " Key=%d", key )
switch( key )
{
case 0: client_cmd( id, "connect rgm4.vicp.net:27015" )
case 1: client_cmd( id, "connect rgm4.vicp.net:27016" )
case 9: client_print( id, print_chat, "菜单操作退出" )
}
return PLUGIN_HANDLED
}

rgm4 发表于 2008-6-1 09:11:39

回复: 谁能帮我修改一下,谢谢了

还是不行进不了没反应,其他ip也试了

Cr@zyTreE 发表于 2008-6-1 09:43:06

回复: 谁能帮我修改一下,谢谢了

Post by rgm4
还是不行进不了没反应,其他ip也试了

#include <amxmod>


to


#include <amxmodx>
页: [1]
查看完整版本: 谁能帮我修改一下,谢谢了