这篇条目有关 Source引擎。如需详情,点击这里。

point_servercommand

From Valve Developer Community
< Zh
Revision as of 02:09, 30 June 2025 by WoShiGeNiCheng (talk | contribs) (Created page with "__NOTOC__ {{CD|CPointServerCommand|file1=client.cpp}} {{this is a|逻辑实体|name=point_servercommand}} 该实体用于向服务器控制台发送命令。只需将其放置在地图中并触发Command输入即可使用,参数应为要执行的精确{{L|console command|控制台命令}}或要修改的{{L|console variable|控制台变量}}。{{confirm|可以使用任何未标记为作弊或隐藏的ConCommands/ConVars。}} {{note|由于滥用风险较高,该实体...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
C++ 类层级
CPointServerCommand
CPointEntity
CBaseEntity
C++ client.cpp

point_servercommand是一个逻辑实体,可在所有的 起源 起源 游戏中使用。 该实体用于向服务器控制台发送命令。只需将其放置在地图中并触发Command输入即可使用,参数应为要执行的精确控制台命令(en)或要修改的控制台变量(en)

证实:可以使用任何未标记为作弊或隐藏的ConCommands/ConVars。
Note.png注意:由于滥用风险较高,该实体受sv_allow_point_servercommand控制台变量限制。

{{note|在Garry's Mod Garry's Mod中,由于滥用问题,point_servercommand(en)point_clientcommand(en)已被移除。

PlacementTip.png解决方案:使用lua_run(en) RunConsoleCommand('command')

}

键值

Name (目标名称) <target_source>[ Edit ]
这个名称是其他实体通过 输入/输出(en) 或其他 关键值(en)(如 parentnametarget) 来引用该实体时使用的标识符。
该名称也会显示在 Hammer 编辑器的 2D 视图和 实体报告(en) 中。
参见:  所有实体均可使用的 通用键值、输入与输出(en)

输入

Command <字符串(en)>
要执行的命令。
Icon-Bug.png错误:在Hammer中,参数字段使用"符号会损坏VMF(en)文件结构,导致下次Hammer会话无法查看文件。  [todo tested in ?]
Note.png修复:需用文本编辑器手动移除字符串参数。

控制台变量

控制台变量/命令 参数或默认值 描述符 效果
sv_allow_point_servercommand "always"

tf2(en) "official"
string 是否允许在地图中使用point_servercommand实体。对不受信任的地图可能有风险。

disallow : 始终禁止
official : 仅限Valve官方地图 only(en)
always  : 允许所有地图

另见