* Server
addEventHandler( "onPlayerJoin", root, function( )
setElementData( source, "download", "Download" )
end )
function chatbox(text, msgtype)
local account = getAccountName(getPlayerAccount(source))
local name = getPlayerName(source)
if ( getElementData ( source, "download" ) == "Download" ) then
cancelEvent ( )
outputChatBox("[ Downloading ] " .. name .. ":#ffffff " .. text, root, 255, 255, 255, true)
end
end
addEventHandler("onPlayerChat", root, chatbox)
* Client
addEventHandler( "onClientResourceStart", resourceRoot, function( )
TimerDownload = setTimer( function( )
if ( isTransferBoxActive ( ) ~= true ) then
setElementData( localPlayer, "download", false )
killTimer( TimerDownload )
end
end, 10000, 0 )
end )