function addTeamColor(player)
local playerTeam = getPlayerTeam ( player )
if ( playerTeam ) then
local r,g,b = getTeamColor ( playerTeam )
local n1 = toHex(r)
local n2 = toHex(g)
local n3 = toHex(b)
if r <= 16 then n1 = "0"..n1 end
if g <= 16 then n2 = "0"..n2 end
if b <= 16 then n3 = "0"..n3 end
return "#"..n1..""..n2..""..n3..""..getPlayerNametagText(player)
else
return getPlayerNametagText(player)
end
end
function toHex ( n )
local hexnums = {"0","1","2","3","4","5","6","7",
"8","9","A","B","C","D","E","F"}
local str,r = "",n%16
if n-r == 0 then str = hexnums[r+1]
else str = toHex((n-r)/16)..hexnums[r+1] end
return str
end
addEvent("onWins", true)
function screenwinning(Player)
x, y = guiGetScreenSize()
PlayerName = addTeamColor(player)
xR, xG, xB = getTeamColor(getPlayerTeam(Player))
winner = dxText:create("* "..PlayerName.." #FFFFFF has won a point!", x / 2, y / 2.8, false, "default-bold", 3, "center")
winner:type('shadow', 1, xR, xG, xB, 175)
timerTime = 5
setTimer(function()winner:visible(false)end, 5500, 1)
end
addEventHandler("onWins", getRootElement(),screenwinning)
triggerClientEvent ( "onWins", getRootElement(),activePlayers[1])