回合开始时自动购买

此脚本在 misc 选项卡中添加了一个“自动购买 AWP”复选框,当 AWP 购买有限时,这对 HvH 很有用。

local ui_get, console_cmd = ui.get, client.exec

local auto_buy_awp = ui.new_checkbox("MISC", "Miscellaneous", "Auto buy AWP")

local function on_round_prestart(e)
	if ui_get(auto_buy_awp) then
		console_cmd("buy awp;")
	end
end
client.set_event_callback("round_prestart", on_round_prestart)