procedure Main(Npc: TNormNpc; Player: TPlayObject; Args: TArgs);
var
I: Integer;
AMap: TEnvirnoment;
begin
AMap := Gamelib.FindMap('0'); //查找一个地图对象
if AMap <> nil then //如果找到了地图对象
begin
for I := 0 to Gamelib.PlayCount - 1 do //循环全部在线玩家
begin
if (Gamelib.Player[I] <> Player) and (Gamelib.Player[I].Map = AMap) then //如果第I个玩家不是当前传入的玩家参数并且其所处地图就是要匹配的地图
begin
Gamelib.Player[I] .SendMessage('你妈喊你回家吃饭!!!');
//此处即可针对该玩家做任何处理
end;
end;
end;
end;