Skip to content

消息模块管理接口 Chat

具体函数名及描述如下:

序号函数名函数描述
1SendChat(...)发送聊天消息
2SendSystemMsg(...)发送系统消息

SendChat

  • 参数及类型:
    • content:string消息
    • playerID:number玩家ID 0表示发给所有玩家
  • 返回值及类型:
    • ret:bool成功(true)
  • 该方法的主要作用: 发送聊天消息
  • 具体使用案例如下:
lua
    Chat:SendChat("聊天信息")

SendSystemMsg

  • 参数及类型:
    • content:string消息
    • playerID:number玩家ID 0表示发给所有玩家
  • 返回值及类型:
    • ret:bool成功(true)
  • 该方法的主要作用: 发送系统消息
  • 具体使用案例如下:
lua
    Chat:SendSystemMsg("系统消息")