Hey, I have wrote you a code, Not tested but works hopefully....
You said new chat type, So ive created a local one... I think thats what u mean...
chat_range=100
addEventHandler("onPlayerJoin",getRootElement(),
function ()
bindKey(source,"U","down","chatbox","Local")
end)
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),
function ()
for index, player in pairs(getElementsByType("player")) do
bindKey(player,"U","down","chatbox","Local")
end
end)
function isPlayerInRangeOfPoint(player,x,y,z,range)
local px,py,pz=getElementPosition(player)
return ((x-px)^2+(y-py)^2+(z-pz)^2)^0.5<=range
end
function onChat(player,i,...)
local px,py,pz=getElementPosition(player)
local nick=getPlayerName(player)
local msg = table.concat({...}, " ")
for i,v in ipairs(getElementsByType("player")) do
if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then
outputChatBox("(local)"..nick..": #ffffff"..msg,v,255,255,255,true)
end
end
end
addCommandHandler("Local",onChat)