图 1.
public wuqishangcheng(id)
{
if(g_gun[id] < 1)
{
new menu = menu_create("\r等级枪械", "menu_handler4");
menu_additem(menu, "\wMP5(0级枪械)", "1", 0)
menu_additem(menu, "\wM3(10级枪械)", "2", 0)
menu_additem(menu, "\wXM1014(20级枪械)", "3", 0)
menu_additem(menu, "\w30级枪械套装", "9", 0)
menu_additem(menu, "\w40级枪械套装", "9", 0)
menu_additem(menu, "\w50级枪械套装", "9", 0)
menu_additem(menu, "\w60级枪械套装", "9", 0)
menu_additem(menu, "\w70级枪械套装", "9", 0)
menu_additem(menu, "\w80级枪械套装", "9", 0)
menu_additem(menu, "\w90级枪械套装", "9", 0)
menu_additem(menu, "\w100级枪械套装", "9", 0)
menu_additem(menu, "\w110级枪械套装", "9", 0)
menu_additem(menu, "\w120级枪械套装", "9", 0)
menu_additem(menu, "\w130级枪械套装", "9", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_setprop(menu, MPROP_BACKNAME,"上页")
menu_setprop(menu, MPROP_NEXTNAME,"下页")
menu_setprop(menu, MPROP_EXITNAME,"离开")
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
else
{
client_printcolor(id,"/g【等级枪械】你选择了一次等级枪械")
return PLUGIN_HANDLED;
}
}
public menu_handler4(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
if(is_user_alive(id) && cs_get_user_team(id) == 2 )
{
strip_user_weapons(id)
give_item(id,"weapon_mp5navy")
give_item(id,"weapon_knife")
give_item(id,"weapon_deagle")
g_gun[id] += 1
client_printcolor(id,"/g【等级枪械】你已获得/ctrMP5/g枪械套装")
}
else if(!is_user_alive(id))
{
client_printcolor(id,"/g【等级枪械】你已经死亡,不能获得枪械")
}
else if(cs_get_user_team(id) == 1)
{
client_printcolor(id,"/g【等级枪械】你不是警察,不能获得枪械")
}
}
case 2:
{
if(get_user_level(id) >= 10 )
if(is_user_alive(id) && cs_get_user_team(id) == 2)
{
strip_user_weapons(id)
give_item(id,"weapon_m3")
give_item(id,"weapon_knife")
give_item(id,"weapon_deagle")
g_gun[id] += 1
client_printcolor(id,"/g【等级枪械】你已获得/ctrM3/g枪械套装")
}
else if(get_user_level(id) <= 10)
{
client_printcolor(id,"/g【等级枪械】你不够等级,不能获得枪械")
}
else if(!is_user_alive(id))
{
client_printcolor(id,"/g【等级枪械】你已经死亡,不能获得枪械")
}
else if(cs_get_user_team(id)== 1)
{
client_printcolor(id,"/g【等级枪械】你不是警察,不能获得枪械")
}
}
case 3:
{
if(get_user_level(id) >= 20 )
if(is_user_alive(id) && cs_get_user_team(id) == 2)
{
strip_user_weapons(id)
give_item(id,"weapon_xm1014")
give_item(id,"weapon_knife")
give_item(id,"weapon_deagle")
g_gun[id] += 1
client_printcolor(id,"/g【等级枪械】你已获得/ctrXM1014/g枪械套装")
}
else if(!get_user_level(id) <= 20)
{
client_printcolor(id,"/g【等级枪械】你不够等级,不能获得枪械")
}
else if(!is_user_alive(id))
{
client_printcolor(id,"/g【等级枪械】你已经死亡,不能获得枪械")
}
else if(cs_get_user_team(id)== 1)
{
client_printcolor(id,"/g【等级枪械】你不是警察,不能获得枪械")
}
}
case 9:
{
client_printcolor(id,"/g【武器商城】这个项目还未推出,敬请留意")
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}