eric512
|
分享:
▼
x0
|
[1.6][插件] SMA問題,請各位幫助
#include <amxmodx> #include <fun> #include <cstrike> new Cvar_BlockKill new g_gun[33] public plugin_init() { register_clcmd( "Gunmenu","Gunmenu"); } stock client_printcolor(const id, const input[], any:...) { new count = 1, players[32] static msg[1024] vformat(msg, 1023, input, 3) replace_all(msg, 1023, "/g", "^4") replace_all(msg, 1023, "/y", "^1") replace_all(msg, 1023, "/ctr", "^3") if (id) players[0] = id else get_players(players, count, "ch") for (new i = 0;i < count;i++) { if (is_user_connected(players)) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players) write_byte(players) write_string(msg) message_end() } } } public Gunmenu(id) { if(g_gun[id] < 1 ) { new menu = menu_create("\r槍械選單", "menu_handler1"); menu_additem(menu, "\yAK47", "1",0); menu_additem(menu, "\yM4A1", "2", 0); menu_additem(menu, "\yAWP", "3", 0) menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } else { client_printcolor(id,"你已選擇槍械!") } return PLUGIN_HANDLED; } public menu_handler1(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(g_gun[id] > 1) { client_printcolor(id,"/g【系統】你已選擇槍械") } else { client_printcolor(id,"/g【系統】已獲得槍械 /ctrAK47") strip_user_weapons(id) give_item(id,"weapon_ak47") give_item(id,"weapon_deagle") g_guns[id] += 1 <-----------這裡有Error menu_destroy(menu) return PLUGIN_HANDLED } } case 2: { if(g_gun[id] > 1) { client_printcolor(id,"/g【系統】你已選擇槍械") } else { client_printcolor(id,"/g【系統】已獲得槍械 /ctrM4A1") strip_user_weapons(id) give_item(id,"weapon_m4a1") give_item(id ,"weapon_deagle") g_guns[id]+= 1 <-----------這裡有Error menu_destroy(menu) return PLUGIN_HANDLED } } case 3: { if(g_gun[id] > 1) { client_printcolor(id,"/g【系統】你已選擇槍械") } else { client_printcolor(id,"/g【系統】已獲得槍械 /ctrAWP") strip_user_weapons(id) give_item(id,"weapon_awp") give_item(id,"weapon_deagle") g_guns[id] += 1 <-----------這裡有Error menu_destroy(menu) return PLUGIN_HANDLED } } } menu_destroy(menu); return PLUGIN_HANDLED; }
[ 此文章被eric512在2013-07-08 13:20重新編輯 ]
|