Lua接口/服务端/GetNearTeamCount:修订间差异
来自雪舞天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| 第8行: | 第8行: | ||
<pre>GetNearTeamCount(sceneId, selfId)</pre> | <pre>GetNearTeamCount(sceneId, selfId)</pre> | ||
服务端脚本中共出现 | 服务端脚本中共出现 200 处调用,实参个数出现过:2 个(200 处)。 | ||
实现位于 <code>LuaFnTbl_Team.h</code>。 | 实现位于 <code>LuaFnTbl_Team.h</code>。 | ||
| 第20行: | 第20行: | ||
| 1 | | 1 | ||
| <code>sceneId</code><br /><span class="lua-muted"><code>number</code></span> | | <code>sceneId</code><br /><span class="lua-muted"><code>number</code></span> | ||
| 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code>(198 处)</span> | | 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code>(198 处)、<code>s</code>(2 处)</span> | ||
|- | |- | ||
| 2 | | 2 | ||
| 第31行: | 第31行: | ||
== 脚本中的调用 == | == 脚本中的调用 == | ||
以下是服务端脚本里的真实调用点,按实参形态去重后列出 | 以下是服务端脚本里的真实调用点,按实参形态去重后列出 6 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。 | ||
<pre>-- event/city/protect_guild.lua | <pre>-- event/city/protect_guild.lua | ||
GetNearTeamCount(sceneId, selfId) | GetNearTeamCount(sceneId, selfId) | ||
| 第37行: | 第37行: | ||
-- event/city/protect_guild.lua | -- event/city/protect_guild.lua | ||
GetNearTeamCount(sceneId, leaderObjId) | GetNearTeamCount(sceneId, leaderObjId) | ||
-- event/fuben/efuben_shaxing.lua | |||
GetNearTeamCount(s, p) | |||
-- event/huodong/zhenlongzhiguang.lua | -- event/huodong/zhenlongzhiguang.lua | ||
2026年10月26日 (一) 22:28的版本
取得selfId玩家附近的队友数量(包括自己)
Lua 调用
GetNearTeamCount(sceneId, selfId)
服务端脚本中共出现 200 处调用,实参个数出现过:2 个(200 处)。
实现位于 LuaFnTbl_Team.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(198 处)、s(2 处)
|
| 2 | selfIdnumber
|
当前场景内的对象 ID。玩家接口需传入有效玩家对象;不是角色 GUID。 脚本中的实参: selfId(139 处)、leaderObjId(55 处)、nSelfId(2 处)
|
返回值
返回 1 个值。返回类型包括 number。明确的固定返回组合包括 -1。
脚本中的调用
以下是服务端脚本里的真实调用点,按实参形态去重后列出 6 条。这些调用取自随包发布的脚本,可用于确认参数顺序与实际传入的值;它们不代表该写法在当前版本仍然有效。
-- event/city/protect_guild.lua GetNearTeamCount(sceneId, selfId) -- event/city/protect_guild.lua GetNearTeamCount(sceneId, leaderObjId) -- event/fuben/efuben_shaxing.lua GetNearTeamCount(s, p) -- event/huodong/zhenlongzhiguang.lua GetNearTeamCount(sceneId, activatorId) -- event/juqing/juxianzhuang_03.lua GetNearTeamCount(sceneId, nSelfId) -- obj/huodong/BibleStoredRoom_Receiver.lua GetNearTeamCount(sceneId, leader)
注意事项
- 调用对象必须是当前场景中的有效玩家。