CS2 控制台 命令
搜索 238 条 CS2 现在确实存在的命令和变量,附游戏自己报告的默认值和限制。已经失效的在单独的标签里,方便你分清旧攻略和现状。
试试 crosshair、fps_max、bot 或 demo。选一个分类缩小范围。
控制台与配置
运行、保存和管理你的设置。
| 命令 | 作用 | 默认值 | 范围 | 适用位置 |
|---|---|---|---|---|
exec exec <file> | 运行 game/csgo/cfg 文件夹里的 .cfg 文件。不要带 .cfg 后缀。 | 客户端 | ||
execifexists execifexists <file> | 只有文件存在时才运行配置,不存在也不会报错。 | 客户端 | ||
host_writeconfig | 把你当前的设置保存到 config.cfg。 | 客户端 | ||
bind bind "<key>" "<command>" | 把一个按键或鼠标按键绑定到一条命令。 | 客户端 | ||
unbind unbind <key> | 移除某个按键上的绑定。 | 客户端 | ||
unbindall | 移除所有绑定。之后请重新绑定你的移动键,或者运行 binddefaults。 | 客户端 | ||
binddefaults | 把所有按键绑定恢复为默认值。 | 客户端 | ||
alias alias "<name>" "<commands>" | 创建一个简短的名字,用来运行一串命令。 | 客户端 | ||
echo echo <text> | 在控制台打印一行。放在配置里可以方便确认它是否运行。 | 客户端 | ||
toggle toggle <cvar> [value1 value2 ...] | 每按一次,在几个值之间切换一个 cvar,例如 toggle cl_showfps 0 1。 | 客户端 | ||
incrementvar incrementvar <cvar> <min> <max> <step> | 把一个 cvar 按固定幅度递增,在最小值和最大值之间循环。 | 客户端 | ||
cyclevar cyclevar <cvar> <value1> <value2> ... | 让一个 cvar 在一列值中循环。 | 客户端 | ||
toggleconsole | 打开或关闭控制台。 | 客户端 | ||
find find <text> | 在控制台命令和 cvar 中搜索某个词。 | 客户端 | ||
help help <name> | 打印某个命令或 cvar 的帮助。 | 客户端 | ||
cvarlist | 列出游戏知道的所有控制台变量和命令。 | 客户端 | ||
differences | 列出你相对默认值修改过的 cvar。 | 客户端 | ||
key_listboundkeys | 列出你绑定过的所有按键。 | 客户端 | ||
key_findbinding key_findbinding <command> | 显示某条命令绑定在哪个按键上。 | 客户端 | ||
con_enable | 允许打开控制台。与“启用开发者控制台”设置相同。 | false | 客户端 | |
status | 打印你的连接、服务器和服务器上的玩家。 | 客户端 | ||
maps | 列出游戏可以加载的地图。 | 客户端 | ||
map map <name> | 加载一张地图。离线时会开始一局本地游戏。 | 客户端 | ||
changelevel changelevel <name> | 在你运行的服务器上更换地图。 | 客户端 | ||
connect connect <address> | 连接到服务器。 | 客户端 | ||
disconnect | 离开当前游戏。 | 客户端 | ||
quit | 关闭 CS2。 | 客户端 |
准星
每个准星设置都是单独的 cvar。颜色是按通道分别设置的,不是一个数字。
| 命令 | 作用 | 默认值 | 范围 | 适用位置 |
|---|---|---|---|---|
cl_crosshairstyle | 准星样式。游戏接受 0 到 9。 | 7 | 0 到 9 | 客户端 |
cl_crosshairdot | 绘制中心圆点。 | false | 客户端 | |
cl_crosshair_t | T 形准星:隐藏上方的线。 | false | 客户端 | |
cl_crosshair_drawoutline | 描边:0 关闭,1 开启,2 是游戏的第二种描边模式。 | 1 | 0 到 2 | 客户端 |
cl_crosshair_length | 每条准星线的长度。 | 8 | 0 到 255 | 客户端 |
cl_crosshair_thickness | 线条粗细。 | 2 | 0 到 32 | 客户端 |
cl_crosshair_gap | 中心与线条之间的间隙。负值会让线条重叠。 | 4 | -3840 到 3840 | 客户端 |
cl_crosshaircolor_r | 红色通道,0 到 255。 | 0 | 0 到 255 | 客户端 |
cl_crosshaircolor_g | 绿色通道,0 到 255。 | 255 | 0 到 255 | 客户端 |
cl_crosshaircolor_b | 蓝色通道,0 到 255。 | 0 | 0 到 255 | 客户端 |
cl_crosshaircolor_a | 不透明度,0 到 255。 | 255 | 0 到 255 | 客户端 |
cl_crosshairoutline_r | 描边红色,0 到 255。 | 0 | 0 到 255 | 客户端 |
cl_crosshairoutline_g | 描边绿色,0 到 255。 | 0 | 0 到 255 | 客户端 |
cl_crosshairoutline_b | 描边蓝色,0 到 255。 | 0 | 0 到 255 | 客户端 |
cl_crosshairoutline_a | 描边不透明度,0 到 255。 | 255 | 0 到 255 | 客户端 |
cl_crosshair_recoil | 让准星跟随后坐力。 | true | 客户端 | |
cl_crosshair_sniper_width | 狙击镜十字线的宽度。1 表示一像素的细线。 | 1 | 客户端 | |
cl_crosshair_friendly_warning | 当队友处于你的射击线上时,改变准星。 | 1 | 0 到 1 | 客户端 |
cl_crosshair_dynamic_splitdist | 准星扩散时,线条分开多远。 | 3 | 0 到 127 | 客户端 |
cl_crosshair_dynamic_spread_limit | 动态准星最多能张开多大。 | 255 | 0 到 255 | 客户端 |
cl_grenadecrosshair_keepusercrosshair | 在显示投掷物准星时,保留你自己的准星。 | true | 客户端 | |
cl_show_observer_crosshair | 观战时你看到的是谁的准星。 | 2 | 客户端 |
持枪视角与 FOV
武器在屏幕上的位置。范围是游戏内置的限制。
| 命令 | 作用 | 默认值 | 范围 | 适用位置 |
|---|---|---|---|---|
viewmodel_fov | 持枪视角的视野。 | 60 | 60 到 68 | 客户端 |
viewmodel_offset_x | 把枪向左(负值)或向右(正值)移动。 | 1 | -2 到 2.5 | 客户端 |
viewmodel_offset_y | 把枪移近或移远镜头。 | 1 | -2 到 2 | 客户端 |
viewmodel_offset_z | 把枪向下(负值)或向上(正值)移动。 | -1 | -2 到 2 | 客户端 |
viewmodel_presetpos | 应用内置位置预设:1 桌面,2 经典。 | 1 | 客户端 | |
cl_prefer_lefthanded | 用左手持武器。 | false | 客户端 | |
fov_desired | 基础视野。 | 75 | 1 到 135 | 客户端 |
r_drawtracers_firstperson | 显示或隐藏你自己的子弹轨迹。 | true | 客户端 |
HUD 与雷达
屏幕布局和小地图。
| 命令 | 作用 | 默认值 | 范围 | 适用位置 |
|---|---|---|---|---|
cl_hud_color | 0 = team color, 1 = white, 2 = bright white, 3 = light blue, 4 = blue, 5 = purple, 6 = red, 7 = orange, 8 = yellow, 9 = green, 10 = aqua, 11 = pink, 12 = teammate color. | 0 | 客户端 | |
hud_scaling | 缩放 HUD。 | 1 | 0.9 到 1.1 | 客户端 |
cl_hud_radar_scale | 雷达在屏幕上的大小。 | 1 | 0.8 到 1.3 | 客户端 |
cl_radar_scale | 雷达内的地图缩放。数值越小,显示的地图范围越大。 | 0.7 | 0.25 到 1 | 客户端 |
cl_radar_always_centered | If set to 0, the radar is maximally used. Otherwise the player is always centered, even at map extents. | true | 客户端 | |
cl_radar_rotate | 让雷达随你的视角旋转。 | true | 客户端 | |
cl_radar_icon_scale_min | Sets the minimum icon scale. Valid values are 0.4 to 1.25. | 0.6 | 0.4 到 1.25 | 客户端 |
cl_radar_square_with_scoreboard | 打开计分板时,把雷达变成方形。 | true | 客户端 | |
cl_hud_radar_background_alpha | 雷达背景的不透明度。 | 0.627 | 0 到 1 | 客户端 |
cl_hud_radar_blur_background | Blurs the radar background. | true | 客户端 | |
cl_teamid_overhead_mode | Always show team id over teammates. 0 = off, 1 = pips; 2 = +name, 3 = +equipment | 3 | 客户端 | |
cl_teammate_colors_show | In competitive, 1 = show teammates as separate colors in the radar, scoreboard, etc., 2 = show colors and letters | 1 | 客户端 | |
cl_showloadout | Toggles display of current loadout. | true | 客户端 | |
hud_showtargetid | Enables display of target names | true | 客户端 | |
cl_show_clan_in_death_notice | Is set, the clan name will show next to player names in the death notices. | true | 客户端 | |
cl_deathnotices_show_numbers | 0: default; 1: draw names as just numbers; 2: append number on killer and victim to the name | 0 | 客户端 | |
cl_draw_only_deathnotices | 隐藏除准星和击杀信息以外的 HUD。用于拍视频。 | false | 客户端 | |
cl_drawhud | Enable the rendering of the hud | true | 作弊保护 | |
cl_autohelp | 开启自动帮助提示。 | true | 客户端 | |
gameinstructor_enable | Display in game lessons that teach new players. | false | 客户端 | |
cl_disable_round_end_report | 隐藏回合结束报告。 | false | 客户端 | |
cl_cursor_scale | 缩放菜单中的鼠标光标。 | 1 | 客户端 | |
cl_sanitize_player_names | Replace names of other players with something non-offensive. | false | 客户端 | |
cl_hide_avatar_images | Hide avatar images for other players. 0 - Off. 1 - Block All 2 - Block all but friends | 0 | 客户端 |
音频
音量范围是 0 到 1。
| 命令 | 作用 | 默认值 | 范围 | 适用位置 |
|---|---|---|---|---|
volume | 主音量。 | 1 | 0 到 1 | 客户端 |
snd_gamevolume | Game volume | 1 | 0 到 1 | 客户端 |
snd_gamevoicevolume | Game v.o. volume | 1 | 0 到 1 | 客户端 |
snd_voipvolume | 其他玩家语音聊天的音量。 | 1 | 0 到 2 | 客户端 |
snd_musicvolume | Music volume | 1 | 0 到 1 | 客户端 |
snd_menumusic_volume | Volume of Menu / Non-gameplay music | 0.04 | 0 到 1 | 客户端 |
snd_mvp_volume | Volume of MVP Music | 0.16 | 0 到 1 | 客户端 |
snd_roundstart_volume | Volume of Round Start Music | 0 | 0 到 1 | 客户端 |
snd_roundend_volume | Volume of Won/Lost Music | 0.16 | 0 到 1 | 客户端 |
snd_roundaction_volume | Volume of Move Action Music | 0 | 0 到 1 | 客户端 |
snd_tensecondwarning_volume | Volume of Ten Second Warnings | 0.04 | 0 到 1 | 客户端 |
snd_deathcamera_volume | Volume of Deathcam Timers | 0.16 | 0 到 1 | 客户端 |
snd_mapobjective_volume | Volume of Map Objective Music | 0.04 | 0 到 1 | 客户端 |
snd_headphone_eq | 选择耳机均衡器预设。 | 0 | 客户端 | |
snd_mute_losefocus | 游戏窗口失去焦点时静音。 | true | 客户端 | |
snd_mute_mvp_music_live_players | If set, MVP music is muted if players from both teams are still alive. | false | 客户端 | |
snd_steamaudio_enable_perspective_correction | Enable perspective correction for 3D audio. | false | 客户端 |
鼠标与输入
灵敏度和操控行为。
| 命令 | 作用 | 默认值 | 范围 | 适用位置 |
|---|---|---|---|---|
sensitivity | Mouse sensitivity. | 1.25 | 0.0001 到 8 | 客户端 |
zoom_sensitivity_ratio | Additional mouse sensitivity scale factor applied when FOV is zoomed in. | 1 | 0.01 到 3 | 客户端 |
sensitivity_y_scale | Multiplies the mouse Y axis for finer pitch vs yaw aim | 1 | 0 到 2 | 客户端 |
m_yaw | Mouse yaw factor. | 0.022 | 客户端 | |
m_pitch | Mouse pitch factor. | 0.022 | 客户端 | |
mouse_inverty | 反转鼠标的垂直移动。 | false | 客户端 | |
option_duck_method | 切换式蹲下,而不是按住。 | false | 客户端 | |
option_speed_method | 切换式静步,而不是按住。 | false | 客户端 | |
cl_debounce_zoom | Whether or not to disable holding secondary fire to cycle zoom levels | true | 客户端 | |
cl_sniper_auto_rezoom | Auto-rezoom snipers after a shot | true | 客户端 | |
cl_silencer_mode | 0: cannot detach; 1: press secondary fire to detach | 0 | 客户端 | |
cl_use_opens_buy_menu | Pressing the +use key will open the buy menu if in a buy zone (just as if you pressed the 'buy' key). | false | 客户端 | |
cl_weapon_stealth_reload_toggle | Should the silent reload act like a toggle | false | 客户端 | |
cl_scoreboard_mouse_enable_binding | 在计分板上释放鼠标光标的绑定。 | +attack2 | 客户端 | |
input_button_code_is_scan_code_scd | Bind keys based on keyboard position instead of key name | true | 客户端 | |
cl_allow_multi_input_binds | 允许绑定包含多个输入动作。受作弊保护,所以只有 sv_cheats 1 时才有效。 | false | 作弊保护 |
网络、帧率与诊断
帧率、网络显示和计时。旧的 net_graph 和 cl_cmdrate 这一类已经没有了,见下面的已移除列表。
| 命令 | 作用 | 默认值 | 范围 | 适用位置 |
|---|---|---|---|---|
fps_max | Frame rate limiter. 0=no limit. Does not apply to dedicated server. | 120 | 客户端 | |
fps_max_ui | Frame rate limiter while the game UI is displayed. 0=no limit. Does not apply to dedicated server. | 0 | 客户端 | |
engine_low_latency_sleep_after_client_tick | When r_low_latency is enabled, this moves the low latency sleep on tick frames to happen after client simulation. | false | 客户端 | |
cl_showfps | Draw fps meter at top of screen (1 = fps, 2 = smooth fps, 3 = server MS, 4 = Show FPS and Log to file ) | 0 | 客户端 | |
cl_showpos | 显示你的位置和速度。在当前游戏中受作弊保护。 | 0 | 作弊保护 | |
cl_hud_telemetry_ping_show | Show ping in the HUD. 0=never, 1=only in poor conditions, 2=always | 1 | 客户端 | |
cl_hud_telemetry_frametime_show | Show frame time (FPS) in the HUD. 0=never, 1=only if poor, 2=always | 1 | 客户端 | |
cl_hud_telemetry_net_misdelivery_show | Show percentage of user commands & server snapshots that are missed due to network conditions. 0=never, 1=only in poor conditions, 2=always | 1 | 客户端 | |
cl_hud_telemetry_net_quality_graph_show | Show packet jitter and netframe loss/reordering in the HUD. 0=never, 1=only in poor conditions, 2=always | 0 | 客户端 | |
cl_hud_telemetry_serverrecvmargin_graph_show | Show graph of the server recv margin in the HUD. (How early/late user commands are arriving at the server before they are executed.) 0=never, 1=only when there are command queue problems, 2=always | 0 | 客户端 | |
cl_ticktiming cl_ticktiming {print|<interval>} [summary|detail] | {print|<interval>} [summary|detail] Print timing stats now, or set report interval | 客户端 | ||
net_status | 打印网络状态。 | 客户端 | ||
rate | Min bytes/sec the host can receive data | 80000 | 客户端 | |
cl_net_buffer_ticks | Number of ticks of delay for server snapshots and user commands. This value controls the value of cl_interp_ratio, which you should not modify directly. | 0 | 0 到 2 | 客户端 |
cl_interp_ratio | Set number of client simulation interpolation ticks. | 2 | 0 到 19 | 客户端 |
cl_timeout | After this many seconds without receiving a packet from the server, the client will disconnect itself | 30 | 客户端 | |
mm_dedicated_search_maxping | 匹配搜索服务器时倾向的最大延迟。 | 150 | 25 到 350 | 客户端 |
r_fullscreen_gamma | Screen Gamma (only in fullscreen modes) | 2.2 | 1 到 4 | 客户端 |
cl_ragdoll_limit | Maximum number of ragdolls to show (-1 disables limit) | 20 | 客户端 |
语音、聊天与标记
交流相关的设置。
| 命令 | 作用 | 默认值 | 范围 | 适用位置 |
|---|---|---|---|---|
voice_modenable | Enable/disable voice in this mod. | true | 客户端 | |
voice_vox | Voice chat uses a vox-style always on | 0 | 客户端 | |
voice_threshold | decibel threshold for how loud the talker's input signal is before we think they are talking. | -120 | 客户端 | |
voice_loopback | 把你自己的声音回放给你。 | false | 客户端 | |
voice_toggle_open_mic | 切换开麦。 | 客户端 | ||
voice_modenable_toggle | Toggle the voice_modenable convar. | 客户端 | ||
+voicerecord | 按住时按键说话。 | 客户端 | ||
cl_mute_enemy_team | Block all communication from players on the enemy team. | false | 客户端 | |
cl_mute_all_but_friends_and_party | Only allow communication from friends and matchmaking party members. Set to 1 to apply the in non-competitive game modes. Set to 2 will apply the setting in all modes. | 0 | 客户端 | |
cl_player_ping_mute | 控制标记是否发出声音。Valve 的描述说 1 为可听、0 为静音,与名字给人的感觉相反。 | 0 | 客户端 | |
player_ping | Creates a ping notification where the player is looking. | 服务器 | ||
cl_radial_radio_tap_to_ping | When tapping the radial radio button, leave a ping if nothing is selected within the time in seconds set in cl_radial_menu_tap_duration | true | 客户端 | |
say say "<text>" | 向所有人发送消息。 | 服务器 | ||
say_team say_team "<text>" | 向你的队伍发送消息。 | 服务器 | ||
callvote callvote <issue> | Start a vote on an issue. | 服务器 |
购买与库存
购买绑定和武器切换的命令。
| 命令 | 作用 | 默认值 | 范围 | 适用位置 |
|---|---|---|---|---|
buy buy <weapon> | 在可以购买时按名称购买物品,例如 buy ak47。可以用 ; 连着写多个。 | 客户端 | ||
autobuy | Attempt to purchase items with the order listed in cl_autobuy | 客户端 | ||
rebuy | Attempt to repurchase items with the order listed in cl_rebuy | 客户端 | ||
cl_autobuy | 自动购买尝试购买的顺序,例如 cl_autobuy "ak47 m4a1 vesthelm"。 | 客户端 | ||
cl_rebuy | The order in which rebuy will attempt to repurchase items | 客户端 | ||
buymenu | Show or hide main buy menu | 客户端 | ||
buyrandom | Buy random primary and secondary. Primarily for deathmatch where cost is not an issue. | 服务器 | ||
use use <weapon_name> | 切换到你携带的武器或物品,例如 use weapon_smokegrenade。 | 客户端 | ||
drop | 丢弃你手里的武器。 | 客户端 | ||
lastinv | 切换到你的上一把武器。 | 客户端 | ||
slot1 | 选择 1 号栏位的武器(主武器)。 | 客户端 | ||
slot2 | 选择 2 号栏位的武器(副武器)。 | 客户端 | ||
slot3 | 选择 3 号栏位的武器(刀)。 | 客户端 | ||
+lookatweapon | 按住时检视你的武器。 | 客户端 | ||
+cl_show_team_equipment | 按住按键时显示队友的装备。 | 客户端 |
练习与私人服务器
服务器端命令。它们只在你自己运行的服务器上有效:离线地图、练习服务器或创意工坊地图。标为作弊保护的条目还需要 sv_cheats 1。这些在 Valve 的匹配服务器上都不起作用。
| 命令 | 作用 | 默认值 | 范围 | 适用位置 |
|---|---|---|---|---|
sv_cheats | Allow cheats on server | false | 客户端 | |
mp_restartgame mp_restartgame <seconds> | If non-zero, game will restart in the specified number of seconds | 0 | 服务器 | |
mp_warmup_end | End warmup immediately. | 服务器 | ||
mp_warmup_pausetimer | Set to 1 to stay in warmup indefinitely. Set to 0 to resume the timer. | 0 | 客户端 | |
mp_roundtime | How many minutes each round takes. | 5 | 0.1 到 60 | 服务器 |
mp_roundtime_defuse | How many minutes each round of Bomb Defuse takes. If 0 then use mp_roundtime instead. | 0 | 0 到 60 | 服务器 |
mp_freezetime | how many seconds to keep players frozen when the round starts | 6 | 0 到 60 | 服务器 |
mp_buytime | How many seconds after round start players can buy items for. | 90 | 0 到 … | 客户端 |
mp_buy_anywhere | When set, players can buy anywhere, not only in buyzones. 0 = default. 1 = both teams. 2 = Terrorists. 3 = Counter-Terrorists. | 0 | 客户端 | |
mp_maxmoney | maximum amount of money allowed in a player's account | 16000 | 0 到 … | 客户端 |
mp_startmoney | amount of money each player gets when they reset | 800 | 0 到 … | 客户端 |
mp_c4timer | how long from when the C4 is armed until it blows | 40 | 10 到 … | 客户端 |
mp_ignore_round_win_conditions | Ignore conditions which would end the current round | false | 服务器 | |
mp_round_restart_delay | Number of seconds to delay before restarting a round after a win | 7 | 0 到 … | 客户端 |
mp_respawn_on_death_ct | When set to 1, counter-terrorists will respawn after dying. | false | 客户端 | |
mp_respawn_on_death_t | When set to 1, terrorists will respawn after dying. | false | 客户端 | |
mp_free_armor | Determines whether kevlar (1+) and/or helmet (2+) are given automatically. | 0 | 客户端 | |
mp_defuser_allocation | How to allocate defusers to CTs at start or round: 0=none, 1=random, 2=everyone | 0 | 0 到 2 | 客户端 |
mp_give_player_c4 | Whether this map should spawn a c4 bomb for a player or not. | true | 客户端 | |
mp_autoteambalance | 自动在队伍之间调动玩家,让双方人数保持均衡。 | true | 服务器 | |
mp_limitteams | Max # of players 1 team can have over another (0 disables check) | 2 | 0 到 30 | 服务器 |
mp_friendlyfire | Allows team members to injure other members of their team | false | 客户端 | |
mp_solid_teammates | How solid are teammates: 0 = transparent; 1 = fully solid; 2 = can stand on top of heads | 1 | 客户端 | |
mp_pause_match | Pause the match in the next freeze time | 服务器 | ||
mp_unpause_match | Resume the match | 服务器 | ||
mp_teamname_1 | A non-empty string overrides the first team's name. | 服务器 | ||
mp_teamname_2 | A non-empty string overrides the second team's name. | 服务器 | ||
ammo_grenade_limit_total | 玩家最多总共能携带多少颗投掷物。 | 3 | 客户端 | |
sv_infinite_ammo | Player's active weapon will never run out of ammo | 0 | 作弊保护 | |
sv_grenade_trajectory_prac_pipreview | Shows grenade trajectory practice picture-in-picture preview. | false | 客户端 | |
sv_grenade_trajectory_prac_trailtime | Shows grenade trajectory practice visualization for this number of seconds. | 0 | 0 到 8 | 客户端 |
sv_rethrow_last_grenade | Emit the last grenade thrown on the server. | 作弊保护 | ||
sv_showimpacts | Shows client (red) and server (blue) bullet impact point (1=both, 2=client-only, 3=server-only) | 0 | 客户端 | |
sv_showimpacts_time | Duration bullet impact indicators remain before disappearing | 4 | 0 到 10 | 客户端 |
weapon_accuracy_nospread | Disable weapon inaccuracy spread | false | 客户端 | |
sv_gravity | World gravity. | 800 | 客户端 | |
sv_airaccelerate | 空中能控制方向的程度。调高会让空中变向更容易。 | 12 | 客户端 | |
host_timescale | Prescale the clock by this amount. | 1 | 作弊保护 | |
god | Toggle by default, or 0 to disable and 1 to enable. Player becomes invulnerable. | 作弊保护 | ||
noclip | Toggle. Player becomes non-solid and flies. Optional argument of 0 or 1 to force enable/disable | 作弊保护 | ||
give give <item> | Give item to player. Arguments: <item_name> | 服务器 | ||
kick kick <name> | Kick a player by name. | 客户端 | ||
kickid kickid <userid> | Kick a player by userid or uniqueid, with a message. | 客户端 |
机器人
你自己运行的服务器上的机器人。
| 命令 | 作用 | 默认值 | 范围 | 适用位置 |
|---|---|---|---|---|
bot_add | bot_add <t|ct> <type> <difficulty> <name> - Adds a bot matching the given criteria. | 服务器 | ||
bot_add_t | bot_add_t <type> <difficulty> <name> - Adds a terrorist bot matching the given criteria. | 服务器 | ||
bot_add_ct | bot_add_ct <type> <difficulty> <name> - Adds a Counter-Terrorist bot matching the given criteria. | 服务器 | ||
bot_kick | bot_kick <all> <t|ct> <type> <difficulty> <name> - Kicks a specific bot, or all bots, matching the given criteria. | 服务器 | ||
bot_difficulty | Defines the skill of bots joining the game. Values are: 0=easy, 1=normal, 2=hard, 3=expert. | 1 | 服务器 | |
bot_stop | bot_stop <1|all> | <not_bomber> | <t> | <ct> | 0 | 作弊保护 | |
bot_freeze | 机器人站着不动。 | false | 作弊保护 | |
bot_zombie | If nonzero, bots will stay in idle mode and not attack. | false | 作弊保护 | |
bot_crouch | 机器人蹲下。 | false | 作弊保护 | |
bot_dont_shoot | If nonzero, bots will not fire weapons (for debugging). | false | 作弊保护 | |
bot_knives_only | Restricts the bots to only using knives | 服务器 | ||
bot_pistols_only | Restricts the bots to only using pistols | 服务器 | ||
bot_place | bot_place - Places a bot from the map at where the local player is pointing. | 作弊保护 |
录像与观战
录制和观看回放。
| 命令 | 作用 | 默认值 | 范围 | 适用位置 |
|---|---|---|---|---|
record record <name> | Record a demo. | 作弊保护 | ||
stop | Finish recording demo. | 客户端 | ||
playdemo playdemo <name> | Play a recorded demo file (.dem ). | 客户端 | ||
demoui | Show/hide demo playback ui | 客户端 | ||
demo_pause | Pauses demo playback. | 客户端 | ||
demo_resume | Resumes demo playback. | 客户端 | ||
demo_togglepause | Toggles demo playback. | 客户端 | ||
demo_timescale demo_timescale <speed> | Sets demo replay speed. | 客户端 | ||
demo_gototick demo_gototick <tick> | Skips to a tick in demo. | 客户端 | ||
demo_goto | Skips to location in demo. | 客户端 | ||
demo_info | Print information about currently playing demo. | 客户端 | ||
demolist | Print demo sequence list. | 客户端 | ||
demo_highlight_seconds_before | How many seconds before the actual highlight event to show when viewing highlights. | 6 | 客户端 | |
spec_mode | Set spectator mode | 客户端 | ||
spec_next | Spectate next player | 客户端 | ||
spec_prev | Spectate previous player | 客户端 | ||
spec_player | Spectate a player by name or slot | 客户端 | ||
spec_goto | Move the spectator camera to a specific location. `spec_goto x y z pitch yaw` | 客户端 | ||
cl_obs_interp_enable | Enables interpolation between observer targets | true | 客户端 |
已不存在的旧命令
这些命令出现在 CS:GO 攻略里,但不在 CS2 的命令列表里,所以会打印未知命令的错误。对照 2026年10月28日 的游戏文件检查。
| 旧命令 | 原来的作用 | 替代方案 |
|---|---|---|
| net_graph | 屏幕上的网络和帧数图表 | cl_showfps 和 cl_hud_telemetry_* 变量 |
| cq_netgraph | 常被说成是 net_graph 的替代品 | 它不是 CS2 命令。请用 cl_showfps 和 cl_hud_telemetry_* |
| cl_cmdrate | 客户端命令速率 | 无需设置。游戏自己管理更新速率 |
| cl_updaterate | 服务器更新速率 | 无需设置。游戏自己管理更新速率 |
| cl_righthand | 左手或右手持枪 | cl_prefer_lefthanded |
| cl_bobamt_lat | 持枪视角左右晃动 | 无。晃动相关变量已被移除 |
| cl_bobamt_vert | 持枪视角上下晃动 | 无。晃动相关变量已被移除 |
| cl_bob_lower_amt | 武器下沉晃动 | 无。晃动相关变量已被移除 |
| cl_bobcycle | 晃动周期长度 | 无。晃动相关变量已被移除 |
| cl_usenewbob | 切换持枪视角的晃动样式 | 无。晃动相关变量已被移除 |
| viewmodel_recoil | 持枪视角后坐力幅度 | 无。该变量已被移除 |
| m_rawinput | 鼠标原始输入 | 控制台里无需设置 |
| cl_lagcompensation | 延迟补偿开关 | 无。客户端无法关闭它 |
| cl_predict | 客户端预测开关 | 无。客户端无法关闭它 |
| voice_scale | 语音音量 | snd_voipvolume |
| voice_enable | 语音开关 | voice_modenable |
| cl_crosshaircolor | 预设准星颜色 0 到 5 | cl_crosshaircolor_r、_g、_b 和 _a |
| cl_grenadepreview | 投掷物轨迹预览 | 练习服务器上的 sv_grenade_trajectory_prac_pipreview |
我们是怎么核实的
上面的每条命令和变量,除了游戏自己处理的几个(buy、use、drop、+jump、+duck、+attack、+voicerecord),都在 CS2 自己的命令和变量表的自动导出文件(日期 2026年10月28日)里查过。默认值、范围,以及作弊和服务器标记,都直接来自那份导出文件。游戏自己的描述缺失或不清楚的地方,我们补写了说明。如果某条命令不在导出文件里,它就不在这份列表里。
“适用位置”一列读取的是游戏的标记:作弊保护需要 sv_cheats 1,服务器在你控制的服务器上运行,客户端在你自己的游戏上运行。
怎么打开控制台并运行命令
在设置、游戏里开启“启用开发者控制台”,然后按控制台键(波浪号 ~)。输入命令并按回车。变量,也就是 cvar,在名字后面带一个值,所以 fps_max 0 设置的是帧率上限。命令则是运行后执行某件事,比如 disconnect。想不改设置、在启动时就打开控制台,把 -console 加到你的 CS2 启动项里。
你在控制台里输入的内容,下次就没了,除非游戏保存它。很多变量被标记为会保存,自己就能延续。其余的,把这些行放进 autoexec.cfg,我们的 CS2 autoexec 生成器可以生成,或者用 CS2 绑定生成器给某个按键配一条命令。
“适用位置”一列是什么意思
列表共有 238 条。“适用位置”一列读取的是游戏给每一条设置的标记。198 条是客户端,在你自己的游戏上运行;25 条是服务器,只在你控制的服务器上生效,比如 mp_、bot_ 和 sv_ 这几类;15 条是作弊保护,需要 sv_cheats 1,所以只能在离线或你自己的服务器上用。在 Valve 的匹配服务器上,服务器和作弊保护的命令会打印错误,什么也不做。
这就是“范围”一列重要的原因。变量有范围时,游戏会把超出范围的值截断。持枪视角的偏移就是个好例子,我们的 CS2 持枪视角生成器让滑块停在同样的限制上。准星标签列出了准星背后的变量,CS2 准星生成器会替你写好它们,还有实时预览。
关于瞄准,灵敏度变量在“鼠标与输入”标签里,范围是 0.0001 到 8。乘以你的 DPI 就是 eDPI,或者用灵敏度转换器把别的游戏的灵敏度换过来。
常见问题
CS2 里怎么打开控制台?
进入设置,再进入游戏,把“启用开发者控制台”设为是。然后按控制台键,默认是波浪号键(~)。在启动项里加上 -console 也可以在启动时打开。
命令和 cvar 有什么区别?
命令是运行后会执行某件事,比如 quit 或 disconnect。cvar(控制台变量)保存的是一个设置,比如 sensitivity 或 fps_max,输入它的名字再加一个值来修改。
“作弊保护”是什么意思?
标为作弊保护的命令,只有在服务器开启 sv_cheats 1 时才会运行,也就是你自己的服务器或离线地图。在匹配和大多数社区服务器上,它们会打印错误并且什么也不做。
哪些命令只能在我自己的服务器上用?
标为“服务器”的那些,包括 mp_、bot_ 和 sv_ 开头的命令,比如 mp_roundtime 或 bot_add。它们改变的是比赛的运行方式,所以只有你控制的服务器才接受。在 Valve 的匹配服务器上它们没有作用。
怎么让设置永久生效?
把它们放进 game/csgo/cfg 文件夹里的 autoexec.cfg,并在启动项里加上 +exec autoexec。我们的 autoexec 生成器可以帮你生成这个文件。
为什么列表里没有 net_graph 或 cl_cmdrate?
它们不在 CS2 的命令列表里。想看帧数、延迟和丢包,请用 cl_showfps 和 cl_hud_telemetry 命令。下面的已移除表格列出了会失效的旧命令。
使用控制台命令会被封号吗?
这里列出的控制台命令不会。它们是游戏的一部分。作弊保护的命令在关闭作弊的服务器上无法使用。