描述
当玩家连接到服务器时会调用此回调。姓名 | 描述 |
---|---|
playerid | 连接的玩家的 ID。 |
返回
0 - 将阻止其他过滤器脚本接收此回调。 1 - 表示此回调将传递给下一个过滤器脚本。 它总是在过滤器脚本中首先被调用。例子
public OnPlayerConnect(playerid)
{
new
string[64],
playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(string, sizeof string, "%s has joined the server. Welcome!", playerName);
SendClientMessageToAll(0xFFFFFFAA, string);
return 1;
}