addEventHandler("onPlayerLogin",root,function()
bindKey(source,"n","down","chatbox","Frakcja")
end)
addCommandHandler("Frakcja",function(plr,cmd,...)
if ... then
local frakcja=getElementData(plr,"player:fraction")
if frakcja then
for _,v in ipairs (getElementsByType("player")) do
if getElementData(v,"player:fraction") then
if getElementData(v,"player:fraction")==frakcja then
local msg=table.concat({...}," ")
outputChatBox("#ff0000"..frakcja.." >#ffffff "..getPlayerName(plr).." : "..msg,v,255,255,255,true)
end
end
end
end
end
end)
addCommandHandler("Frakcja",function(plr,cmd,...)
if ... then
local frakcja = getPlayerTeam(plr)
if frakcja then
for _,v in ipairs (getElementsByType("player")) do
if getElementData(v,"player:fraction") then
if getElementData(v,"player:fraction")==frakcja then
local msg=table.concat({...}," ")
outputChatBox("#ff0000"..frakcja.." >#ffffff "..getPlayerName(plr).." : "..msg,v,255,255,255,true)
end
end
end
end
end
end)
Tylko, ?e nie wiem co wsadzi? w tym miejscu, w sumie wiem co zrobi?, przynajmniej my?l?, ?e pobra? graczy z teamu;
if getElementData(v,"player:fraction") then
if getElementData(v,"player:fraction")==frakcja then
local msg=table.concat({...}," ")
outputChatBox("#ff0000"..frakcja.." >#ffffff "..getPlayerName(plr).." : "..msg,v,255,255,255,true)
end
end
Zrobi?em w inny spos?b, do?? prosty, tutaj dla ciekawskich.
local playerTeam = getPlayerTeam(source)
local pobierz = getPlayersInTeam( playerTeam )
for index, goscie in ipairs( pobierz ) do
outputChatBox("", goscie, 255, 255, 255, true)
end
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach