Lua接口/服务端/SetHumanGuildInt:修订间差异
来自雪舞天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| 第38行: | 第38行: | ||
返回 1 个值。返回类型包括 <code>number</code>。明确的固定返回组合包括 <code>1</code>;<code>-1</code>。 | 返回 1 个值。返回类型包括 <code>number</code>。明确的固定返回组合包括 <code>1</code>;<code>-1</code>。 | ||
== | == 调用示例 == | ||
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序: | |||
<pre>-- event/fuben/efuben_bangzhan.lua | <pre>-- event/fuben/efuben_bangzhan.lua | ||
SetHumanGuildInt(sceneId, mems[i], j, 0) | SetHumanGuildInt(sceneId, mems[i], j, 0) | ||
-- event/fuben/efuben_bangzhan.lua | -- event/fuben/efuben_bangzhan.lua | ||
SetHumanGuildInt(sceneId, selfId, ArrayIntIndex, value)</pre> | SetHumanGuildInt(sceneId, selfId, ArrayIntIndex, value)</pre> | ||
2026年10月27日 (二) 12:38的最新版本
设置人物帮战临时整数数组中的指定值。
Lua 调用
SetHumanGuildInt(sceneId, selfId, arrayIndex, value)
服务端脚本中共出现 3 处调用,实参个数出现过:4 个(3 处)。
实现位于 LuaFnTbl_Guild.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(3 处)
|
| 2 | selfIdnumber
|
当前场景内的对象 ID。玩家接口需传入有效玩家对象;不是角色 GUID。 脚本中的实参: mems[i](2 处)、selfId
|
| 3 | arrayIndexnumber
|
数组条目索引。 脚本中的实参: j(2 处)、ArrayIntIndex
|
| 4 | valuenumber
|
要写入的数值。 脚本中的实参: 0(2 处)、value
|
返回值
返回 1 个值。返回类型包括 number。明确的固定返回组合包括 1;-1。
调用示例
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序:
-- event/fuben/efuben_bangzhan.lua SetHumanGuildInt(sceneId, mems[i], j, 0) -- event/fuben/efuben_bangzhan.lua SetHumanGuildInt(sceneId, selfId, ArrayIntIndex, value)
注意事项
- 调用对象必须是当前场景中的有效玩家。