|
发表于 2013-6-16 11:58:41
|
显示全部楼层
来自 中国–广东–深圳
- #include <amxmodx>
- #include <amxmisc>
- #define PLUGIN "ServerMenu"
- #define VERSION "1.3"
- #define AUTHOR "yzmzx"
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_clcmd( "opmenu","ShowMenu", -1, "Shows The Server Menu" )
- register_menucmd(register_menuid("\y【\r管理员菜单\y】"), 1023, "MenuCommand" )
- return PLUGIN_CONTINUE
- }
- public ShowMenu( id )
- {
- new szMenuBody[256]
- new keys
-
- new nLen = format( szMenuBody, 255, "\y【\r管理员菜单\y】^n" )
-
- nLen += format( szMenuBody[nLen], 255-nLen, "^n\r1. \w踢出玩家" )
- nLen += format( szMenuBody[nLen], 255-nLen, "^n\r2. \w封禁玩家" )
- nLen += format( szMenuBody[nLen], 255-nLen, "^n\r3. \w重开新局" )
- nLen += format( szMenuBody[nLen], 255-nLen, "^n\r4. \w更换地图" )
- nLen += format( szMenuBody[nLen], 255-nLen, "^n\r5. \w投票换图" )
- nLen += format( szMenuBody[nLen], 255-nLen, "^n\r6. \w处罚玩家" )
- nLen += format( szMenuBody[nLen], 255-nLen, "^n\r7. \w队伍控制" )
- nLen += format( szMenuBody[nLen], 255-nLen, "^n\r8. \r重起服务器" )
- nLen += format( szMenuBody[nLen], 255-nLen, "^n^n\r0. \w退出" )
-
- keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<9)
-
- show_menu( id, keys, szMenuBody, -1 )
- return PLUGIN_CONTINUE
- }
- public MenuCommand( id, key )
- {
- switch( key )
- {
- case 0: {
- client_cmd(id, "amx_kickmenu" )
- }
- case 1: {
- client_cmd(id, "amx_banmenu" )
- }
- case 2: {
- client_cmd(id, "amx_cmdmenu" )
- }
- case 3: {
- client_cmd(id, "amx_mapmenu" )
- }
- case 4: {
- client_cmd(id, "amx_votemapmenu" )
- }
- case 5: {
- client_cmd(id, "amx_slapmenu" )
- }
- case 6: {
- client_cmd(id, "amx_teammenu" )
- }
- case 7: {
- client_cmd(id, "amx_shutdown" )
- }
- case 9: {
- client_print( id, print_chat, "菜单操作退出" )
- }
- }
-
- return PLUGIN_HANDLED
- }
复制代码 |
|