addEventHandler("onPlayerChat", root, function(tresc, msgtype)
if (msgtype == 0) then
cancelEvent()
local x,y,z = getElementPosition(source)
for key, gracze in ipairs(getElementsByType("player")) do
local x2,y2,z2 = getElementPosition(gracze)
if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<20) then
local int = getElementInterior(source)
local dim = getElementDimension(source)
local int2 = getElementInterior(gracze)
local dim2 = getElementDimension(gracze)
if (int == int2 and dim == dim2) then
outputChatBox("#0000FF("..getElementData(source,"id")..")#ffffff ".. getPlayerName(source) ..":#ffffff ".. tresc, gracze, 255, 255, 255, true)
end
end
end
end
end)