描述

当玩家连接到服务器时会调用此回调。
姓名 描述
playerid 连接的玩家的 ID。

返回

0 - 将阻止其他过滤器脚本接收此回调。 1 - 表示此回调将传递给下一个过滤器脚本。 它总是在过滤器脚本中首先被调用。

例子

  1. public OnPlayerConnect(playerid)
  2. {
  3. new
  4. string[64],
  5. playerName[MAX_PLAYER_NAME];
  6. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  7. format(string, sizeof string, "%s has joined the server. Welcome!", playerName);
  8. SendClientMessageToAll(0xFFFFFFAA, string);
  9. return 1;
  10. }

笔记

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