|
ADMIN_LEVEL_C 权限
需要配合
say_menu.amxx ; Say menu 菜单
custommenuitems.cfg内添加
amx_addclientmenuitem "队伍转移" "set_team_menu" "o" "Vip_Set"
|
#include
#include
#include
#define PLUGIN_NAME "Change Team Menu"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "KIN"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_clcmd( "say team","Changemenu", ADMIN_RESERVATION, "Shows The Change Teams Menu" )
register_menucmd(register_menuid("\r队伍转移菜单^n"), 1023, "cgtheMenu" )
return PLUGIN_CONTINUE
}
public Changemenu(id,level)
{
if (!access(id,level))
{
client_print(id,print_center,"你无权使用该道具!")
console_print(id,"你无权使用该道具!")
return PLUGIN_CONTINUE
}
if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
{
client_print(id,print_center,"观察者不能使用该道具!")
console_print(id,"观察者不能使用该道具!")
return PLUGIN_CONTINUE
}
new cgMenu[256]
new keys
new nLen = format( cgMenu, 255, "\r队伍转移菜单^n" )
nLen += format( cgMenu[nLen], 255-nLen, "^n\r1. \w 恐怖份子" )
nLen += format( cgMenu[nLen], 255-nLen, "^n\r2. \w 反恐精英" )
nLen += format( cgMenu[nLen], 255-nLen, "^n^n\r0. \w 退出" )
keys = (1<<0|1<<1|1<<2|1<<9)
show_menu( id, keys, cgMenu, -1 )
return PLUGIN_CONTINUE
}
public cgtheMenu(id,key)
{
switch(key)
{
case 0: {
if(cs_get_user_team(id) == CS_TEAM_T)
{
client_print(id,print_center,"你现在为恐怖份子,不需要更换队伍!")
console_print(id,"你现在为恐怖份子,不需要更换队伍!")
return PLUGIN_CONTINUE
}
else
{
cs_set_user_team(id, CS_TEAM_T, CS_T_GUERILLA)
user_kill(id, 1)
if (is_user_alive(id))
{
user_kill(id, 1)
}
return PLUGIN_CONTINUE
}
}
case 1: {
if(cs_get_user_team(id) == CS_TEAM_CT)
{
client_print(id,print_center,"你现在为反恐精英,不需要更换队伍!")
console_print(id,"你现在为反恐精英,不需要更换队伍!")
return PLUGIN_CONTINUE
}
else
{
cs_set_user_team(id, CS_TEAM_CT, CS_CT_GSG9)
user_kill(id,1)
if(is_user_alive(id))
{
user_kill(id, 1)
}
return PLUGIN_CONTINUE
}
}
case 9: {
client_print( id, print_chat, "退出转移菜单" )
console_print(id,"退出转移菜单")
}
}
return PLUGIN_HANDLED
}
|
|