搜索
查看: 3859|回复: 15

求助、高手来啊...不能在购买区购买

[复制链接]
发表于 2010-4-26 23:23:54 | 显示全部楼层 |阅读模式 来自 黑龙江大庆
本帖最后由 wzx616313359 于 2010-4-27 19:09 编辑

  • 求帮助啊~! 能编译了 。但是在购买区 买不了武器 - -

    抑郁死了啊~!!! 谁能帮帮忙啊~! 或者直接给我一个无购买Bug的Amxx啊!
    #include <amxmodx>
    #include <cstrike>
    #include <fun>
    //#define DEBUG

    new bool:buyswitch

    public plugin_init() {
            register_plugin("buy m4ak","2.3","kid741010")
            register_clcmd("say /m4","M4")
            register_clcmd("say /ak","AK")
            register_cvar("m4cost","3100")
            register_cvar("akcost","2500")
            register_logevent("round_start",2,"0=World triggered","1=Round_Start")
            //1.5就用这句
            register_event("ResetHUD", "eResetHUD", "be")
            //1.6就用这句
            //register_event("HLTV","eResetHUD","a","a=0","2=0")
    }

    public M4(id) {
            new m4cost = get_cvar_num("m4cost")
            new money = cs_get_user_money(id)
            if(!is_user_alive(id)) {
                    client_color(id, id, "^x04[Ti Shi]^x03Ling Huen Hai Neng Yong Qiang?")
                    //client_print(id,print_chat,"Huo ZHe Cai Neng Mai^n")
                    return PLUGIN_CONTINUE
            }
            if(money < m4cost) {
                    client_color(id, id, "^x04[Ti Shi]^x03Mei You Qian Hai Xiang Mai Qiang?")
                    return PLUGIN_CONTINUE                 
            }
            if (cs_get_user_hasprim(id)){     //增加行
                    client_color(id, id, "^x04[Ti Shi]^x03Ni Yi Jing You Wu Qi Le?^n")
                    return PLUGIN_CONTINUE                 
            }
            if(!cs_get_user_buyzone(id)){
                    client_color(id, id, "^x04[Ti Shi]^x03Zhi Neng Zai Gou Mai Qu Gou Mai!")
                    return PLUGIN_CONTINUE
            }
            if(!buyswitch){
                    client_color(id, id, "^x04[Ti Shi]^x03Gou Mai Shi Jian Yi Guo!")
                    return PLUGIN_CONTINUE
            }
            else {
                    cs_set_user_money(id,money-m4cost)
                    give_item(id, "weapon_m4a1")
                    cs_set_user_bpammo(id,CSW_M4A1,90)
            }
            return PLUGIN_CONTINUE
    }
    public AK(id) {
            new akcost = get_cvar_num("akcost")
            new moneyy = cs_get_user_money(id)
            if(!is_user_alive(id)) {
                    client_color(id, id, "^x04[Ti Shi]^x03Ling Huen Hai Neng Yong Qiang?")
                    return PLUGIN_CONTINUE                 
            }
            if(moneyy < akcost) {
                    client_color(id, id, "^x04[Ti Shi]^x03Mei You Qian Hai Xiang Mai Qiang?")
                    return PLUGIN_CONTINUE                 
            }
            if (cs_get_user_hasprim(id)) {  //增加行
                    client_color(id, id, "^x04[Ti Shi]^x03Ni Yi Jing You Wu Qi Le?^n")
                    return PLUGIN_CONTINUE                 
            }        
            if(!cs_get_user_buyzone(id)){
                    client_color(id, id, "^x04[Ti Shi]^x03Zhi Neng Zai Gou Mai Qu Gou Mai!")
                    return PLUGIN_CONTINUE                 
            }
            if(!buyswitch){
                    client_color(id, id, "^x04[Ti Shi]^x03Gou Mai Shi Jian Yi Guo!")
                    return PLUGIN_CONTINUE                 
            }
            else {
                    cs_set_user_money(id,moneyy-akcost)
                    give_item(id, "weapon_ak47")
                    cs_set_user_bpammo(id,CSW_AK47,90)
            }
            return PLUGIN_CONTINUE         
    }  

    public eResetHUD()
    {
            new Float:buytime=get_cvar_float("mp_buytime")*60
            buyswitch=true
            set_task(buytime,"buy")
    }
    public buy()
    {
            buyswitch=false
    }  
    public round_start()
    {
            client_print(0,print_chat,"CT Gou Mai AK T Gou Mai M4a1 say/m4 & say/ak")
            
    }

    public client_color(playerid, colorid, msg[])
    {
            message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),_,playerid)
            write_byte(colorid)
            write_string(msg)
            message_end()
    }
    /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
    *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
    */
 楼主| 发表于 2010-4-26 23:28:51 | 显示全部楼层 来自 黑龙江大庆
抑郁 、、、、
回复

使用道具 举报

 楼主| 发表于 2010-4-27 02:11:22 | 显示全部楼层 来自 黑龙江大庆
不能沉下去、、、
回复

使用道具 举报

发表于 2010-4-27 07:54:26 | 显示全部楼层 来自 广东中山
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <fun>
  4. //#define DEBUG

  5. new bool:buyswitch

  6. public plugin_init() {
  7.         register_plugin("buy m4ak","2.3","kid741010")
  8.         register_clcmd("say /m4","M4")
  9.         register_clcmd("say /ak","AK")
  10.         register_cvar("m4cost","3100")
  11.         register_cvar("akcost","2500")
  12.         register_logevent("round_start",2,"0=World triggered","1=Round_Start")
  13.         //1.5就用这句
  14.         register_event("ResetHUD", "eResetHUD", "be")
  15.         //1.6就用这句
  16.         //register_event("HLTV","eResetHUD","a","a=0","2=0")
  17. }

  18. public M4(id) {
  19.         new m4cost = get_cvar_num("m4cost")
  20.         new money = cs_get_user_money(id)
  21.         if(!is_user_alive(id)) {
  22.                 client_color(id, id, "^x04[Ti Shi]^x03Ling Huen Hai Neng Yong Qiang?")
  23.                 //client_print(id,print_chat,"Huo ZHe Cai Neng Mai^n")
  24.                 return PLUGIN_CONTINUE
  25.         }
  26.         if(money < m4cost) {
  27.                 client_color(id, id, "^x04[Ti Shi]^x03Mei You Qian Hai Xiang Mai Qiang?")
  28.                 return PLUGIN_CONTINUE                 
  29.         }
  30.         if (cs_get_user_hasprim(id)){     //增加行
  31.                 client_color(id, id, "^x04[Ti Shi]^x03Ni Yi Jing You Wu Qi Le?^n")
  32.                 return PLUGIN_CONTINUE                 
  33.         }
  34.         if(!cs_get_user_buyzone(id)){
  35.                 client_color(id, id, "^x04[Ti Shi]^x03Zhi Neng Zai Gou Mai Qu Gou Mai!")
  36.                 return PLUGIN_CONTINUE
  37.         }
  38.         if(!buyswitch){
  39.                 client_color(id, id, "^x04[Ti Shi]^x03Gou Mai Shi Jian Yi Guo!")
  40.                 return PLUGIN_CONTINUE
  41.         }
  42.         else {
  43.                 cs_set_user_money(id,money-m4cost)
  44.                 give_item(id, "weapon_m4a1")
  45.                 cs_set_user_bpammo(id,CSW_M4A1,90)
  46.         }
  47.         return PLUGIN_CONTINUE
  48. }
  49. public AK(id) {
  50.         new akcost = get_cvar_num("akcost")
  51.         new moneyy = cs_get_user_money(id)
  52.         if(!is_user_alive(id)) {
  53.                 client_color(id, id, "^x04[Ti Shi]^x03Ling Huen Hai Neng Yong Qiang?")
  54.                 return PLUGIN_CONTINUE                 
  55.         }
  56.         if(moneyy < akcost) {
  57.                 client_color(id, id, "^x04[Ti Shi]^x03Mei You Qian Hai Xiang Mai Qiang?")
  58.                 return PLUGIN_CONTINUE                 
  59.         }
  60.         if (cs_get_user_hasprim(id)) {  //增加行
  61.                 client_color(id, id, "^x04[Ti Shi]^x03Ni Yi Jing You Wu Qi Le?^n")
  62.                 return PLUGIN_CONTINUE                 
  63.         }        
  64.         if(!cs_get_user_buyzone(id)){
  65.                 client_color(id, id, "^x04[Ti Shi]^x03Zhi Neng Zai Gou Mai Qu Gou Mai!")
  66.                 return PLUGIN_CONTINUE                 
  67.         }
  68.         if(!buyswitch){
  69.                 client_color(id, id, "^x04[Ti Shi]^x03Gou Mai Shi Jian Yi Guo!")
  70.                 return PLUGIN_CONTINUE                 
  71.         }
  72.         else {
  73.                 cs_set_user_money(id,moneyy-akcost)
  74.                 give_item(id, "weapon_ak47")
  75.                 cs_set_user_bpammo(id,CSW_AK47,90)
  76.         }
  77.         return PLUGIN_CONTINUE         
  78. }  

  79. public eResetHUD()
  80. {
  81.         new Float:buytime=get_cvar_float("mp_buytime")*60
  82.         buyswitch=true
  83.         set_task(buytime,"buy")
  84. }
  85. public buy()
  86. {
  87.         buyswitch=false
  88. }  
  89. public round_start()
  90. {
  91.         client_print(0,print_chat,"CT Gou Mai AK T Gou Mai M4a1 say/m4 & say/ak")
  92.        
  93. }

  94. public client_color(playerid, colorid, msg[])
  95. {
  96.         message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),_,playerid)
  97.         write_byte(colorid)
  98.         write_string(msg)
  99.         message_end()
  100. }
  101. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  102. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
  103. */
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

发表于 2010-4-27 10:13:26 | 显示全部楼层 来自 福建漳州
没什么问题嘛,可以通过编译,只是有部分警告,因为代码未对齐,对齐代码之后无任何警告和错误。
回复

使用道具 举报

 楼主| 发表于 2010-4-27 18:11:20 | 显示全部楼层 来自 黑龙江大庆
本帖最后由 wzx616313359 于 2010-4-27 18:38 编辑

不能在购买区 买武器啊 !!!!
回复

使用道具 举报

 楼主| 发表于 2010-4-27 18:18:33 | 显示全部楼层 来自 黑龙江大庆
还是不行、、在购买区 买不了枪 - -
抑郁啊~!
回复

使用道具 举报

 楼主| 发表于 2010-4-27 19:09:47 | 显示全部楼层 来自 黑龙江大庆
4# 20576526
不能在购买区购买 呜呜、、、
回复

使用道具 举报

 楼主| 发表于 2010-4-27 23:20:13 | 显示全部楼层 来自 黑龙江大庆
不能沉、、、、
回复

使用道具 举报

 楼主| 发表于 2010-4-29 02:38:31 | 显示全部楼层 来自 黑龙江哈尔滨
汗~! 点通没人了么?
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表