圖 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;
}