搜索
查看: 8653|回复: 17

50点通币求个AWP限制插件(不要awplimit.amxx)

[复制链接]
发表于 2009-5-3 23:28:32 | 显示全部楼层 |阅读模式 来自 中国–河南–许昌
本帖最后由 银闪闪 于 2009-5-15 16:52 编辑

求个CT和T双方各只能买两把AWP,如果别人还要买,中间文字提示:不好意思,AWP已经被抢购完了  

不要awplimit.amxx(因这个插件只要赢对方三局以上赢方就不能买AWP了)



谢谢高手 给个吧!
 楼主| 发表于 2009-5-9 18:50:13 | 显示全部楼层 来自 中国–河南–漯河
mei ren you ma ?
回复

使用道具 举报

发表于 2009-5-13 09:35:50 | 显示全部楼层 来自 中国–广西–百色–田东县
mei ren you ma ?
银闪闪 发表于 2009-5-9 18:50

支持你,打仗哪里有那么多AWP给你用啊?
回复

使用道具 举报

 楼主| 发表于 2009-5-13 19:40:41 | 显示全部楼层 来自 中国–河南–漯河
支持你,打仗哪里有那么多AWP给你用啊?
心静如水 发表于 2009-5-13 09:35

恩,就是就是,求高手写一个吧?带上源码,谢谢了·!
回复

使用道具 举报

 楼主| 发表于 2009-5-15 20:29:00 | 显示全部楼层 来自 中国–河南–许昌
顶上来,50点通币跪求源码
回复

使用道具 举报

发表于 2009-5-15 22:14:24 | 显示全部楼层 来自 中国–广东–广州–白云区
限制每队的awp数量插件
{:3_59:} 50点通币你点比我啊{:3_51:}
  1. #include <amxmod>

  2. #define MAXAWPS 2 // number of awps a team can have
  3. #define WINSPREAD 3 // the difference when it starts restricting awps for winning team

  4. new plist[32] = { 0, ... }   // 0 = no awp; 1 = carrying awp
  5. new awp_count[3]         // 1 = T; 2 = CT
  6. new ctscore = 0
  7. new tscore = 0

  8. /* handles restricting the menu */
  9. public menu_awp(id,key) {
  10.    if (get_cvar_num("awplimit")!=1) return PLUGIN_CONTINUE
  11.    new team = get_user_team(id)
  12.    
  13.    if((team == 2 && ctscore-tscore >= WINSPREAD) || (team == 1 && tscore-ctscore >= WINSPREAD))
  14.    {
  15.       engclient_cmd(id,"menuselect","10")
  16.       client_print(id,print_center,"You are on the winning team and cannot use AWP's")
  17.       return PLUGIN_HANDLED
  18.    }
  19.    
  20.    if(awp_count[team] >= MAXAWPS)
  21.    {
  22.       
  23.       engclient_cmd(id,"menuselect","10")
  24.       client_print(id,print_center,"Too many people on your team have AWP's")
  25.       return PLUGIN_HANDLED
  26.    }
  27.    return PLUGIN_CONTINUE
  28. }

  29. /* handles if they script the AWP buy*/
  30. public cmdawp(id)
  31. {
  32.    if (get_cvar_num("awplimit")!=1) return PLUGIN_CONTINUE
  33.    new team = get_user_team(id)
  34.    
  35.    if((team == 2 && ctscore-tscore >= WINSPREAD) || (team == 1 && tscore-ctscore >= WINSPREAD))
  36.    {
  37.       client_print(id,print_center,"You are on the winning team and cannot use AWP's")
  38.       return PLUGIN_HANDLED
  39.    }
  40.    
  41.    if(awp_count[team] >= MAXAWPS)
  42.    {
  43.       client_print(id,print_center,"Too many people on your team have AWP's")
  44.       return PLUGIN_HANDLED
  45.    }
  46.    return PLUGIN_CONTINUE
  47. }

  48. /* handles when a player drops their weapon */
  49. public handle_drop(id) {
  50.    if (get_cvar_num("awplimit")!=1) return PLUGIN_CONTINUE
  51.    if (plist[id] == 1)
  52.    {
  53.       new tmp1,tmp2
  54.       new curweapon = get_user_weapon(id,tmp1,tmp2)

  55.       if (curweapon == 18)
  56.       {
  57.          plist[id] = 0
  58.          new team = get_user_team(id)
  59.          awp_count[team]--
  60.       }
  61.    }
  62.    return PLUGIN_CONTINUE
  63. }

  64. /* handles when a player picks up an awp */
  65. public handle_pickup(id) {

  66.    if (get_cvar_num("awplimit")!=1) return PLUGIN_CONTINUE
  67.    new team = get_user_team(id)

  68.    if((team == 2 && ctscore-tscore >= WINSPREAD) || (team == 1 && tscore-ctscore >= WINSPREAD))
  69.    {  
  70.       client_print(id,print_center,"You are on the winning team and cannot use AWP's")
  71.       client_cmd(id,"weapon_awp;wait;wait;wait;drop")
  72.       return PLUGIN_CONTINUE        
  73.    }
  74.   
  75.    if (awp_count[team] >= MAXAWPS)
  76.    {
  77.       client_print(id,print_center,"Too many people on your team have AWP's")
  78.       client_cmd(id,"weapon_awp;wait;wait;wait;drop")
  79.       return PLUGIN_CONTINUE        
  80.    }
  81.    else
  82.    {
  83.       plist[id] = 1
  84.       awp_count[team]++
  85.    }
  86.    return PLUGIN_CONTINUE
  87. }

  88. /* removes awp when player dies */
  89. public handle_death() {
  90.    if (get_cvar_num("awplimit")!=1) return PLUGIN_CONTINUE
  91.    new idx = read_data(2)

  92.    if(plist[idx] == 1)
  93.    {
  94.       new team = get_user_team(idx)
  95.       awp_count[team]--

  96.       plist[idx] = 0
  97.    }
  98.    return PLUGIN_CONTINUE
  99. }

  100. /* clear vars when player connects */
  101. public client_connect(id) {
  102.    if (get_cvar_num("awplimit")!=1) return PLUGIN_CONTINUE
  103.    plist[id] = 0 // just to make sure
  104.    return PLUGIN_CONTINUE
  105. }

  106. /* clear vars when player disconnects */
  107. public client_disconnect(id) {

  108.    if (get_cvar_num("awplimit")!=1) return PLUGIN_CONTINUE
  109.    if (plist[id] == 1)
  110.    {
  111.       new team = get_user_team(id)
  112.       awp_count[team]--
  113.    }
  114.    plist[id] = 0
  115.    return PLUGIN_CONTINUE
  116. }

  117. public team_score()
  118. {
  119.    if (get_cvar_num("awplimit")!=1) return PLUGIN_CONTINUE
  120.    new team[32]
  121.    read_data(1,team,32)

  122.    if (equal(team,"CT")){
  123.       ctscore = read_data(2)
  124.    }
  125.    else if (equal(team,"TERRORIST")){
  126.       tscore = read_data(2)
  127.    }
  128.    return PLUGIN_CONTINUE
  129. }

  130. public check_winning_team(id)
  131. {
  132.    if (get_cvar_num("awplimit")!=1) return PLUGIN_CONTINUE
  133.    if (plist[id] == 1)
  134.    {
  135.       new team = get_user_team(id)
  136.    
  137.       if((team == 2 && ctscore-tscore >= WINSPREAD) || (team == 1 && tscore-ctscore >= WINSPREAD))
  138.       {  
  139.          client_print(id,print_center,"You are on the winning team and cannot use AWP's")
  140.          client_cmd(id,"weapon_awp;wait;wait;wait;drop")
  141.          return PLUGIN_CONTINUE
  142.       }
  143.    }
  144.    return PLUGIN_CONTINUE
  145. }

  146. public check_rebuy(id)
  147. {
  148.         if (get_cvar_num("checkrebuy")!=1) return PLUGIN_CONTINUE
  149.         client_print(id,print_center,"Sorry Rebuy command is blocked on this server")

  150.         return PLUGIN_HANDLED
  151. }
  152.   
  153. public plugin_init(){
  154.     register_plugin("AWP Limit (Team/Win)","0.4","SuicideDog")
  155.     register_menucmd(-31,1<<5,"menu_awp")
  156.     register_clcmd("drop","handle_drop")
  157.     register_clcmd("awp","cmdawp")
  158.     register_clcmd("rebuy","check_rebuy")
  159.     register_cvar("awplimit","1")
  160.     register_cvar("checkrebuy","1")
  161.     register_event("TeamScore", "team_score", "a")
  162.     register_event("WeapPickup","handle_pickup","b","1=18")
  163.     register_event("DeathMsg","handle_death","a")
  164.     register_event("ResetHUD","check_winning_team","b")
  165.     return PLUGIN_CONTINUE
  166. }
复制代码
5# 银闪闪
回复

使用道具 举报

发表于 2009-5-15 22:19:33 | 显示全部楼层 来自 中国–广西–百色
顶上来,50点通币跪求源码
银闪闪 发表于 2009-5-15 20:29

点通高手虽多,但除了jim_yang/Rulzy/zwfgdlc........几位老师大公无私以外,.........假设没有这几位...也许论坛已关闭了........所以说很担心论坛后继无人啊...........
回复

使用道具 举报

 楼主| 发表于 2009-5-16 19:10:35 | 显示全部楼层 来自 中国–河南–许昌
限制每队的awp数量插件
{:3_59:} 50点通币你点比我啊{:3_51:}#include  

#define MAXAWPS 2 // number of awps a team can have
#define WINSPREAD 3 // the difference when it starts restricting awps for winn ...
点通粉丝 发表于 2009-5-15 22:14

大哥,请问在哪改中间的文字提示呢?

这个源码好像是awplimit.sma呀
我不要awplimit,因为这个插件有双方比分差3局以上赢方就买不了AWP了,我不要这功能!

能再帮忙修改简单点不?

就是CT和T各队只能各买两把AWP,如果其它玩家还要用B45或B46买:屏幕中间就提示:不好意思,AWP已经被抢购完了


帮忙一下啦,谢谢了
回复

使用道具 举报

发表于 2009-5-16 21:59:13 | 显示全部楼层 来自 中国–广西–百色
本帖最后由 心静如水 于 2009-5-17 12:50 编辑

#define WINSPREAD 30
第四行你这样改看.....................

或用这个试几天看看........有问题就回电...........

本帖子中包含更多资源

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

×
回复

使用道具 举报

 楼主| 发表于 2009-5-17 18:26:57 | 显示全部楼层 来自 中国–河南–许昌
#define WINSPREAD 30
第四行你这样改看.....................

或用这个试几天看看........有问题就回电...........
心静如水 发表于 2009-5-16 21:59

能给个源码吗?我想修改提示
回复

使用道具 举报

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

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