描述

当玩家发送聊天消息时会调用此回调。
姓名 描述
playerid 输入文本的玩家的 ID。
text[] 玩家输入的文本。

返回

它总是在过滤器脚本中首先被调用,因此返回 0 会阻止其他脚本看到它。

例子

  1. public OnPlayerText(playerid, text[])
  2. {
  3. new pText[144];
  4. format(pText, sizeof (pText), "(%d) %s", playerid, text);
  5. SendPlayerMessageToAll(playerid, pText);
  6. return 0; // ignore the default text and send the custom one
  7. }

笔记

提示
这个回调也可以被NPC调用。