廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 1159 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
owner7895
個人文章 個人相簿 個人日記 個人地圖
小人物
級別: 小人物 該用戶目前不上站
推文 x0 鮮花 x0
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[1.6][插件] 連輸補償sma修改 bot也可以用 協助
目前連輸補償只有玩家適用,請問要怎麼修改能單機打bot時 bot也能獲得這個效果




#include <amxmodx>
#include <cstrike>


#define AWARD_LEVELS 5
#define MAX_AWARD 9000


new const award[] = {0, 1000, 2500, 3500, 4500, 5500}
new score[] = {0, 0}
new scale = 0


public teamscore()
{
  new team[2]
  read_data(1,team,1)
  new curTeam = (team[0] == 'C') ? 0 : 1
  new curScore = read_data(2)


  if (curScore == score[curTeam])
    return PLUGIN_CONTINUE


  score[curTeam] = curScore


  // Keep a sliding scale of losses clamped to 7
  // Scale is positive when CT's are winning
  if (curTeam)
  {
    scale += 1
  } else
  {
    scale -= 1
  }
  scale = clamp(scale, 0-AWARD_LEVELS, AWARD_LEVELS)
  log_message("「平安夜公告」 當前按物價計酬法 %d.", scale)


  if (!get_cvar_num("extramoney"))
    return PLUGIN_CONTINUE

  // find the pot amount by converting the sliding scale to an index
  // in the award lookup table
  new pindex = scale
  if (!curTeam)
    pindex = 0-pindex


  new pot = award[clamp(pindex-1, 0, 5)]
  if (!pot)
    return PLUGIN_CONTINUE


  new players[32];
  new playerCount, i
  get_players(players, playerCount, "ce", curTeam ? "CT" : "TERRORIST")
  for (i=0;i < playerCount; i++)
  {
    new money = cs_get_user_money(players)
    new newmoney = max(clamp(money+pot, 0, MAX_AWARD), money) // Only give extra money up to 8000
    cs_set_user_money(players, newmoney, 1)
  }


  return PLUGIN_CONTINUE
}


public plugin_init()
{
  register_plugin("JETB", "0.5", "Janzert")
  register_cvar("extramoney", "1")
  register_event("TeamScore", "teamscore", "a");


  return PLUGIN_CONTINUE
}



獻花 x0 回到頂端 [樓 主] From:臺灣中華電信股份有限公司 | Posted:2023-01-14 21:17 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.022561 second(s),query:15 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言