Lua接口/服务端/AddGlobalCountNews:修订间差异
来自雪舞天龙知识库
跳到导航跳到搜索
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
维护服务端 Lua 接口:核对参数、返回值、边界条件与调用示例 |
||
| (未显示同一用户的4个中间版本) | |||
| 第1行: | 第1行: | ||
__NOTOC__ | __NOTOC__ | ||
<div class="lua-reference | <div class="lua-reference"> | ||
[[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/通用与活动|通用与活动]] · [[Lua接口/服务端调用约定|调用约定]] | [[首页|首页]] · [[Lua接口/服务端函数索引|服务端接口]] · [[Lua接口/服务端函数索引/通用与活动|通用与活动]] · [[Lua接口/服务端调用约定|调用约定]] | ||
<div | <div class="lua-lead lua-rule">向全组服务器发送新闻公告,公告发送指定次数</div> | ||
同一接口的其他调用名称:<code | 同一接口的其他调用名称:<code>LuaFnAddGlobalCountNews</code>。 | ||
== Lua 调用 == | == Lua 调用 == | ||
<pre | <pre>AddGlobalCountNews(sceneId, newstr)</pre> | ||
服务端脚本中共出现 | 服务端脚本中共出现 79 处调用,实参个数出现过:2 个(79 处)。 | ||
实现位于 <code | 实现位于 <code>LuaFnTbl_Misc.h</code>。 | ||
== 参数 == | == 参数 == | ||
{| class="wikitable | {| class="wikitable" | ||
! scope="col" | ! scope="col" class="lua-w11" | 序号 | ||
! scope="col" | ! scope="col" class="lua-w36" | 参数 / 类型 | ||
! scope="col | ! scope="col" | 说明 | ||
|- | |- | ||
| 1 | |||
| <code>sceneId</code><br /><span class="lua-muted"><code>number</code></span> | |||
| 当前调用所在的场景 ID。<br /><span class="lua-muted">脚本中的实参:<code>sceneId</code>(79 处)</span> | |||
|- | |- | ||
| 2 | |||
| <code>newstr</code><br /><span class="lua-muted"><code>string</code></span> | |||
| 公告内容,字符串指针类型<br /><span class="lua-muted">脚本中的实参:<code>str</code>(26 处)、<code>message</code>(20 处)、<code>szMsg</code>(7 处)</span> | |||
|} | |} | ||
| 第36行: | 第36行: | ||
没有测试 | 没有测试 | ||
== | == 调用示例 == | ||
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序: | |||
<pre | <pre>-- city0_building12.lua | ||
AddGlobalCountNews(sceneId, strText) | AddGlobalCountNews(sceneId, strText) | ||
-- event/city/protect_guild_generate.lua | -- event/city/protect_guild_generate.lua | ||
AddGlobalCountNews(sceneId, "@*;SrvMsg;SCA:#P"..cityDefaultName.."告急!帮会城市"..) | AddGlobalCountNews(sceneId, "@*;SrvMsg;SCA:#P"..cityDefaultName.."告急!帮会城市"..) | ||
-- event/equip/equip_bind.lua | -- event/equip/equip_bind.lua | ||
AddGlobalCountNews(sceneId, szMsg | AddGlobalCountNews(sceneId, szMsg)</pre> | ||
</div> | </div> | ||
2026年10月27日 (二) 12:33的最新版本
向全组服务器发送新闻公告,公告发送指定次数
同一接口的其他调用名称:LuaFnAddGlobalCountNews。
Lua 调用
AddGlobalCountNews(sceneId, newstr)
服务端脚本中共出现 79 处调用,实参个数出现过:2 个(79 处)。
实现位于 LuaFnTbl_Misc.h。
参数
| 序号 | 参数 / 类型 | 说明 |
|---|---|---|
| 1 | sceneIdnumber
|
当前调用所在的场景 ID。 脚本中的实参: sceneId(79 处)
|
| 2 | newstrstring
|
公告内容,字符串指针类型 脚本中的实参: str(26 处)、message(20 处)、szMsg(7 处)
|
返回值
无返回值。赋值接收时得到 nil;这与返回数字 0 不同。
用法补充
向全组服务器发送新闻公告,公告发送指定次数
没有测试
调用示例
以下取自随包服务端脚本的真实调用,可对照上方参数表确认参数顺序:
-- city0_building12.lua AddGlobalCountNews(sceneId, strText) -- event/city/protect_guild_generate.lua AddGlobalCountNews(sceneId, "@*;SrvMsg;SCA:#P"..cityDefaultName.."告急!帮会城市"..) -- event/equip/equip_bind.lua AddGlobalCountNews(sceneId, szMsg)