bus1234
|
分享:
▼
x0
|
[1.6][其他] SMA高手帮助,不能转AMXX
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun>
public plugin_init() { register_plugin("Weapon Menu", "1.0", "ME") register_event("ResetHUD","event_hud_reset", "be") }
public event_hud_reset(id) { set_task(0.2,"event_player_spawn",id) }
public event_player_spawn(id) { new CsTeams:team = cs_get_user_team(id) if(!is_user_alive(id)) return PLUGIN_CONTINUE if(team == CS_TEAM_CT) { weaponmenu(id) } return PLUGIN_CONTINUE }
public weaponmenu(id) { new menu = menu_create("\y武器选单", "weaponmenu_handler") menu_additem(menu, "\r雷神激光破", "1", 0) menu_additem(menu, "\r白色STG44", "2", 0) menu_additem(menu, "\r双子银狼", "3", 0) menu_additem(menu, "\w雷霆终结者", "4", 0) menu_additem(menu, "\w霹雳悍将", "5", 0) menu_additem(menu, "\w霹雳战警", "6", 0) menu_additem(menu, "\w缤纷疯兔", "7", 0) menu_additem(menu, "\w白色K1a", "8", 0) menu_additem(menu, "\w闪灵猎手", "9", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0) }
public weaponmenu_handler(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: { give_item(id, "weapon_galil") cs_set_user_bpammo(id , CSW_GALIL , 200) weaponmenuu(id) menu_destroy(menu) return PLUGIN_HANDLED } case 2:{ give_item(id, "weapon_xm1014") cs_set_user_bpammo(id , CSW_XM1014 , 54) weaponmenuu(id) menu_destroy(menu) return PLUGIN_HANDLED } case 3:{ give_item(id, "weapon_ak47") cs_set_user_bpammo(id , CSW_AK47 , 180) weaponmenuu(id) menu_destroy(menu) return PLUGIN_HANDLED } case 4:{ give_item(id, "weapon_m4a1") cs_set_user_bpammo(id , CSW_M4A1 , 200) weaponmenuu(id) menu_destroy(menu) return PLUGIN_HANDLED } case 5:{ give_item(id, "weapon_aug") cs_set_user_bpammo(id , CSW_AUG , 200) weaponmenuu(id) menu_destroy(menu) return PLUGIN_HANDLED } case 6:{ give_item(id, "weapon_ump45") cs_set_user_bpammo(id , CSW_UMP45 , 200) weaponmenuu(id) menu_destroy(menu) return PLUGIN_HANDLED } case 7:{ give_item(id, "weapon_p90") cs_set_user_bpammo(id , CSW_P90 , 180) weaponmenuu(id) menu_destroy(menu) return PLUGIN_HANDLED } case 8:{ give_item(id, "weapon_mp5navy") cs_set_user_bpammo(id , CSW_MP5NAVY , 180) weaponmenuu(id) menu_destroy(menu) return PLUGIN_HANDLED } case 9:{ give_item(id, "weapon_m3") cs_set_user_bpammo(id , CSW_M3 , 85) weaponmenuu(id) menu_destroy(menu) return PLUGIN_HANDLED } } menu_destroy(menu) return PLUGIN_HANDLED }
public weaponmenuu(id) { new menu = menu_create("\r手枪选单", "weaponmenu_handlerr") menu_additem(menu, "\w大嘴猎蜥", "1", 0) menu_additem(menu, "\w石破天惊", "2", 0) menu_additem(menu, "\w夜鹰Deagle", "3", 0) menu_additem(menu, "\w黄金夜鹰", "4", 0) menu_additem(menu, "\w玩命骷髅SKULL-1", "5", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0) }
public weaponmenu_handlerr(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: { give_item(id, "weapon_glock18") cs_set_user_bpammo(id , CSW_GLOCK18 , 200) give_item(id, "weapon_flashbang") give_item(id, "weapon_flashbang") menu_destroy(menu) return PLUGIN_HANDLED } case 2:{ give_item(id, "weapon_usp") cs_set_user_bpammo(id , CSW_USP , 200) give_item(id, "weapon_flashbang") give_item(id, "weapon_flashbang") menu_destroy(menu) return PLUGIN_HANDLED } case 3:{ give_item(id, "weapon_deagle") cs_set_user_bpammo(id, CSW_DEAGLE , 100) give_item(id, "weapon_flashbang") give_item(id, "weapon_flashbang") menu_destroy(menu) return PLUGIN_HANDLED } case 4:{ give_item(id, "weapon_fiveseven") cs_set_user_bpammo(id, CSW_FIVESEVEN , 100) give_item(id, "weapon_flashbang") give_item(id, "weapon_flashbang") menu_destroy(menu) return PLUGIN_HANDLED } case 5:{ give_item(id, "weapon_p228") cs_set_user_bpammo(id, CSW_P228 , 100) give_item(id, "weapon_flashbang") give_item(id, "weapon_flashbang") menu_destroy(menu) return PLUGIN_HANDLED } } menu_destroy(menu) return PLUGIN_HANDLED }
|