isLie
|
分享:
▲
▼
#include <hamsandwich> new coin[33] new reset_bb new float:zhugong[33] new zhugong_need new zhugong_num public plugin_init() { register_plugin("moneygun","1.0","Lie") register_clcmd("say /bbshop","menu") zhugong_need=register_cvar("zhugong_need","1000") zhugong_num=register_cvar("zhugong_num","1") reset_bb=register_cvar("coin","0")
} public menu(id) { if (!is_user_alive(id)) return;
new szMsg[60] formatex(szMsg, 59, "\y叶忆币商礮") new menu = menu_create(szMsg, "menu_money_gun") new n1[64],n2[64],n3[64] format(n1, 63, "\wM4A1") format(n2, 63, "\wAK47") format(n3, 63, "\wM249") menu_additem(menu, n1, 1, 0, -1) menu_additem(menu, n2, 1, 0, -1) menu_additem(menu, n3, 1, 0, -1) menu_setprop(menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, menu, 0) } public menu_level_gun(id, menu, item) { if (item == MENU_EXIT || !is_user_alive(id)) { menu_destroy(menu) return PLUGIN_HANDLED; } if (is_user_alive(id)) { new data[2], itemname[64], access, callback, weapon_id menu_item_getinfo(menu, item, access, data, 5, itemname, 63, callback) if(coin[id] >= 100) { if(data[0] == 1) { if (user_has_weapon(id,CSW_M4A1) { client_print(id,print_center,"你已经有M4A1了,不能再买了") } else { fm_give_item(id, weapon_m4a1) ExecuteHamB(Ham_GiveAmmo, id, 90,556nato,90) coin[id] -= 100 client_print(id,print_center,"成功购买M4A1") return PLUGIN_HANDLED } } else if(data[0] == 2) { if (user_has_weapon(id,CSW_AK47) { client_print(id,print_center,"你已经有AK47了,不能再买了") } else { fm_give_item(id, weapon_ak47) ExecuteHamB(Ham_GiveAmmo, id, 90,762nato,90) coin[id] -= 100 client_print(id,print_center,"成功购买AK47") return PLUGIN_HANDLED } } else if(data[0] == 3) { if (user_has_weapon(id,CSW_M249) { client_print(id,print_center,"你已经有M249了,不能再买了") } else { fm_give_item(id, weapon_m249) ExecuteHamB(Ham_GiveAmmo, id, 200,556natobox,200) coin[id] -= 100 client_print(id,print_center,"成功购买M249") coin[id] -= 100 return PLUGIN_HANDLED } } else { menu_destroy(menu) return PLUGIN_HANDLED; } } } menu_destroy(menu) return PLUGIN_HANDLED; } 我說這位仁兄 你的client_print 跟變數方面都不熟喔 client_print最後怎麼是用(文字)做結尾 應該用"文字") ex:client_print(id,print_center,"文字") 還有不要再刻意用set_coin()什麼的函數了 直接coin[id] -= 100比較實在吧 還有 用新式選單比較簡單喔 (這個就是用新式選單) 去mychat搜尋打新式選單 就查的到他的使用方法喔
喔還有(話好多) 記得用emeditor存成UTF-8不簽名喔
[ 此文章被劍祥天在2013-02-17 14:54重新編輯 ]
|