|
发表于 2010-3-6 10:47:14
|
显示全部楼层
来自 中国–湖北–黄冈
/* 本插件由 EmEditor 中文版自动生成 */
/* 当前文件使用 Unicode (UTF-8) 编码 */
#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
}
龟仙人在2009-2-18写的一个 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|