also habe nen teamsay auf y gemacht mit onPlayerChat, aber es kommt kein text im teamsay wenn ich was eingebe.
Lua
function fchat(message,messageType)
local faction = getElementData(source, "Fraktion")
if (messageType == 2) then
if faction == 1 then
fname = "Polizei"
elseif faction == 2 then
fname = "Sanitäter"
elseif faction == 3 then
fname = "Reporter"
elseif faction == 4 then
fname = "Bundeswehr"
elseif faction == 5 then
fname = "S.W.A.T."
elseif faction == 6 then
fname = "L.C.Nostra"
elseif faction == 7 then
fname = "Yakuza"
elseif faction == 8 then
fname = "Regierung"
elseif faction == 9 then
fname = "Amtsgericht"
elseif faction == 10 then
fname = "Ballas"
elseif faction == 11 then
fname = "Grove Street"
end
if faction ~= 0 then
for index, cPlayer in pairs(getElementsByType( "player" )) do
if getElementData(cPlayer, "Fraktion") == faction then
local rank = getElementData(source, "Rank")
outputChatBox("["..fname.." | "..getPlayerName(source).."]: #FFFFFF "..message.."",cPlayer,255,125,0,true)
end
end
end
end
end
addEventHandler( "onPlayerChat", getRootElement(), fchat)
Alles anzeigen
woran liegt das????