|
发表于 2009-12-7 13:15:48
|
显示全部楼层
|阅读模式
来自 中国–北京–北京–通州区
本帖最后由 kilng 于 2009-12-10 22:23 编辑
加入famas,galil两种枪的购买,还加了个admin不花钱买枪函数,不受地点时间限制,amx_buy ak & m4 & awp等,使用unlimited_money。- /* UTF-8 func by www.DT-Club.net */
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #include <fun>
- #include <unlimited_money>
- new bool:buyswitch
- public plugin_init() {
- register_plugin("buyweapon","1.0","bruto")
- register_concmd("amx_buy", "adminbuy", ADMIN_SLAY, " - AMXX ADMIN BUY WEAPON SCRIPT")
- register_clcmd("say /m4","M4")
- register_clcmd("say /fa","FA")
- register_clcmd("say /ak","AK")
- register_clcmd("say /ga","GA")
- register_cvar("m4cost","3100")
- register_cvar("facost","2250")
- register_cvar("akcost","2500")
- register_cvar("gacost","2000")
- register_logevent("round_start",2,"0=World triggered","1=Round_Start")
- register_event("HLTV","eResetHUD","a","a=0","2=0")
- }
- public adminbuy(id, level, cid){
- if (!cmd_access(id, level, cid, 2))
- return PLUGIN_HANDLED
- new Arg1[4]
- read_argv(1, Arg1, 3)
- if(equali(Arg1[0],"m4")){
- give_item(id, "weapon_m4a1")
- cs_set_user_bpammo(id,CSW_M4A1,90)
- cs_set_user_armor(id,100,CS_ARMOR_VESTHELM)
- console_print(id,"bruto:give me the m4!")
- return PLUGIN_CONTINUE
- }
- if(equali(Arg1[0],"ak")){
- give_item(id, "weapon_ak47")
- cs_set_user_bpammo(id,CSW_AK47,90)
- cs_set_user_armor(id,100,CS_ARMOR_VESTHELM)
- console_print(id,"bruto:give me the ak!")
- return PLUGIN_CONTINUE
- }
- if(equali(Arg1[0],"fa")){
- give_item(id, "weapon_famas")
- cs_set_user_bpammo(id,CSW_FAMAS,90)
- cs_set_user_armor(id,100,CS_ARMOR_VESTHELM)
- console_print(id,"bruto:give me the fa!")
- return PLUGIN_CONTINUE
- }
- if(equali(Arg1[0],"ga")){
- give_item(id, "weapon_galil")
- cs_set_user_bpammo(id,CSW_GALIL,90)
- cs_set_user_armor(id,100,CS_ARMOR_VESTHELM)
- console_print(id,"bruto:give me the ga!")
- return PLUGIN_CONTINUE
- }
- if(equali(Arg1[0],"awp")){
- give_item(id, "weapon_awp")
- cs_set_user_bpammo(id,CSW_AWP,30)
- cs_set_user_armor(id,100,CS_ARMOR_VESTHELM)
- console_print(id,"bruto:give me the awp!")
- return PLUGIN_CONTINUE
- }
- return PLUGIN_CONTINUE
- }
- public round_start(id) {
- client_print(id, print_chat, "警察可以购买AK,GA 匪徒可以购买M4,FA 输入[say /m4 & say /fa & say /ak & say /ga]")
- }
- public M4(id) {
- new m4cost = get_cvar_num("m4cost")
- new moneyy = cs_get_user_money2(id)
- if(!is_user_alive(id)) {
- client_print(id,print_chat,"你已经死亡,不能购买")
- return PLUGIN_CONTINUE
- }
- if(moneyy < m4cost) {
- client_print(id,print_chat,"你的金钱不够")
- return PLUGIN_CONTINUE
- }
- if (cs_get_user_hasprim(id)) {
- client_print(id,print_chat,"你已经拥有一个主武器了")
- return PLUGIN_CONTINUE
- }
- if(!cs_get_user_buyzone(id)){
- client_print(id,print_chat,"你只能在购买区内购买武器")
- return PLUGIN_CONTINUE
- }
- if(!buyswitch){
- client_print(id,print_chat,"购买时间已过")
- return PLUGIN_CONTINUE
- }
- else {
- cs_set_user_money2(id,moneyy-m4cost)
- give_item(id, "weapon_m4a1")
- }
- return PLUGIN_CONTINUE
- }
- public FA(id) {
- new facost = get_cvar_num("facost")
- new moneyy = cs_get_user_money2(id)
- if(!is_user_alive(id)) {
- client_print(id,print_chat,"你已经死亡,不能购买")
- return PLUGIN_CONTINUE
- }
- if(moneyy < facost) {
- client_print(id,print_chat,"你的金钱不够")
- return PLUGIN_CONTINUE
- }
- if (cs_get_user_hasprim(id)) {
- client_print(id,print_chat,"你已经拥有一个主武器了")
- return PLUGIN_CONTINUE
- }
- if(!cs_get_user_buyzone(id)){
- client_print(id,print_chat,"你只能在购买区内购买武器")
- return PLUGIN_CONTINUE
- }
- if(!buyswitch){
- client_print(id,print_chat,"购买时间已过")
- return PLUGIN_CONTINUE
- }
- else {
- cs_set_user_money2(id,moneyy-facost)
- give_item(id, "weapon_famas")
- }
- return PLUGIN_CONTINUE
- }
- public AK(id) {
- new akcost = get_cvar_num("akcost")
- new moneyy = cs_get_user_money2(id)
- if(!is_user_alive(id)) {
- client_print(id,print_chat,"你已经死亡,不能购买")
- return PLUGIN_CONTINUE
- }
- if(moneyy < akcost) {
- client_print(id,print_chat,"你的金钱不够")
- return PLUGIN_CONTINUE
- }
- if (cs_get_user_hasprim(id)) {
- client_print(id,print_chat,"你已经拥有一个主武器了")
- return PLUGIN_CONTINUE
- }
- if(!cs_get_user_buyzone(id)){
- client_print(id,print_chat,"你只能在购买区内购买武器")
- return PLUGIN_CONTINUE
- }
- if(!buyswitch){
- client_print(id,print_chat,"购买时间已过")
- return PLUGIN_CONTINUE
- }
- else {
- cs_set_user_money2(id,moneyy-akcost)
- give_item(id, "weapon_ak47")
- }
- return PLUGIN_CONTINUE
- }
- public GA(id) {
- new gacost = get_cvar_num("gacost")
- new moneyy = cs_get_user_money2(id)
- if(!is_user_alive(id)) {
- client_print(id,print_chat,"你已经死亡,不能购买")
- return PLUGIN_CONTINUE
- }
- if(moneyy < gacost) {
- client_print(id,print_chat,"你的金钱不够")
- return PLUGIN_CONTINUE
- }
- if (cs_get_user_hasprim(id)) {
- client_print(id,print_chat,"你已经拥有一个主武器了")
- return PLUGIN_CONTINUE
- }
- if(!cs_get_user_buyzone(id)){
- client_print(id,print_chat,"你只能在购买区内购买武器")
- return PLUGIN_CONTINUE
- }
- if(!buyswitch){
- client_print(id,print_chat,"购买时间已过")
- return PLUGIN_CONTINUE
- }
- else {
- cs_set_user_money2(id,moneyy-gacost)
- give_item(id, "weapon_galil")
- }
- return PLUGIN_CONTINUE
- }
- public eResetHUD(){
- new Float:buytime=get_cvar_float("mp_buytime")*60
- buyswitch=true
- set_task(buytime,"buy")
- }
- public buy()
- {
- buyswitch=false
- }
复制代码 想把雷买全和当警察时买拆包器就改成,- if(equali(Arg1[0],"m4")){
- give_item(id, "weapon_m4a1")
- give_item(id, "weapon_hegrenade")
- give_item(id, "weapon_flashbang")
- give_item(id, "weapon_flashbang")
- give_item(id, "weapon_smokegrenade")
- cs_set_user_bpammo(id,CSW_M4A1,90)
- cs_set_user_armor(id,100,CS_ARMOR_VESTHELM)
- if (get_user_team(id)==2){
- cs_set_user_defuse(id)
- }
- console_print(id,"bruto:give me the m4!")
- return PLUGIN_CONTINUE
- }
复制代码 其它的自己改吧。 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注个册吧
×
|