0 Üye ve 1 Ziyaretçi konuyu incelemekte.
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")) dobindKey(player,"u","down","chatbox","Local") endend) 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<=rangeend function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player)local r,g,b = getTeamColor(getPlayerTeam(player)) for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("(özel) "..nick..": "..msg,v,r,g,b,true) end endendaddCommandHandler("Local",onChat)
function onChat(player,_,...) local px,py,pz=getElementPosition(player) local msg = table.concat({...}, " ") local nick=getPlayerName(player) local takim = getPlayerTeam(player) if takim then -- eğer takım varsa local r,g,b = getTeamColor(takim) -- takim rengi else -- takim yoksa r,g,b = 255,255,255 -- beyaz renk end for _,v in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(v,px,py,pz,chat_range) then outputChatBox("(özel) "..nick..": "..msg,v,r,g,b,true) end endendaddCommandHandler("Local",onChat)