Please don't reply if you have absolutely no idea what is this about.
@Air: One of the problems I just noticed, is that you have a timer outside of your "drawNexMapString" function, which causes it to execute when the resource starts, so 'winner' is nil then.
Try this:
function drawNexMapString ( player, wintext )
local x, y = guiGetScreenSize ( )
if ( wintext == "none" ) then
else
winnertext = dxText:create ( wintext, x/2, y/2 -180 + 1, false, "default-bold", 1.65, "center" )
winnertext:type ( 'shadow', 1.3, 1 )
winnertext:font ( "default-bold" )
setTimer (
function ( )
winnertext:visible ( false )
end
,5000, 1
)
end
winner = dxText:create ( tostring ( getPlayerNametagText ( player ) ) .." #FFFFFFis the final survivor!", x/2, y/2 -150 + 1, false, "default-bold", 1.65, "center" )
winner:type ( 'shadow', 1.3, 1 )
winner:font ( "default-bold" )
setTimer (
function ( )
winner:visible ( false )
end
,5000, 1
)
end
addEvent ( "onWins", true )
addEventHandler ( "onWins", getRootElement(), drawNexMapString )