VIP队伍转移卡
ADMIN_LEVEL_C 权限需要配合
say_menu.amxx ; Say menu 菜单
custommenuitems.cfg内添加
amx_addclientmenuitem "队伍转移" "set_team_menu" "o" "Vip_Set"#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <string>
public plugin_init()
{
register_plugin("Set_Team", "0.1", "LoveHuai");
register_clcmd("set_team_menu", "Set_Team_Menu")
}
public Set_Team_Menu(id, level, cid)
{
new menu = menu_create("队伍转移:", "Set_Team_Handler")
menu_additem(menu, "转移到反恐精英", "1", ADMIN_LEVEL_C)
menu_additem(menu, "转移到恐怖分子", "2", ADMIN_LEVEL_C)
menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER)
menu_display(id, menu, 0)
return PLUGIN_HANDLED
}
public Set_Team_Handler(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new cmd, name, access
menu_item_getinfo(menu, item, access, cmd, 31, name, 31, access)
if (strcmp(cmd, "1")==0)
{
if (cs_get_user_team(id) == CS_TEAM_T){
if (is_user_alive(id)) {
user_kill(id,1);
}
cs_set_user_team(id,CS_TEAM_CT,CS_CT_URBAN);
}
} else{
if (strcmp(cmd, "2")==0)
{
if (cs_get_user_team(id) == CS_TEAM_CT){
if (is_user_alive(id)) {
user_kill(id,1);
}
cs_set_user_team(id,CS_TEAM_T,CS_T_TERROR);
}
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
沙发。不过好像会失去平衡。 这个不错哟~~! 这个不错,先挣钱。。。 这个不错,先挣钱。。。:victory: 这个不错,先挣钱。。。:victory: /* 本插件由 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
new keys
new nLen = format( cgMenu, 255, "\r队伍转移菜单^n" )
nLen += format( cgMenu, 255-nLen, "^n\r1. \w 恐怖份子" )
nLen += format( cgMenu, 255-nLen, "^n\r2. \w 反恐精英" )
nLen += format( cgMenu, 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写的一个 支持一下!!!谢谢分享! 留个脚印``用时来取! ddddddddddddd
页:
[1]
2