``` unit Q2; interface uses Classes, SysUtils; procedure Main(Npc: TNormNpc; Player: TPlayObject; Args: TArgs); implementation procedure Main(Npc: TNormNpc; Player: TPlayObject; Args: TArgs); var I: Integer; APlayer: TPlayObject; begin //Gamelib.PlayCount 表示当前在线总人数 //Gamelib.Player[I] 表示第I个用户,如果I的值超过在线人数则返回为nil for I := 0 to Gamelib.PlayCount - 1 do //循环全部在线玩家 begin APlayer := Gamelib.Player[I]; if APlayer <> nil then //如果第I个玩家不是当前传入的玩家参数并且其所处地图就是要匹配的地图 begin APlayer.GoHome; //让该玩家回城 APlayer.SendMessage('你妈喊你回家吃饭!!!'); //此处即可针对该玩家做任何处理 end; end; end; end. ```