2016-10-09 16:11:56 +00:00
|
|
|
function d3stats.Map_Message( roundend, ply )
|
|
|
|
local map = game.GetMap()
|
|
|
|
local count, wins, avg_players = d3stats.Storage.Map_Get( map )
|
|
|
|
|
|
|
|
local Message
|
|
|
|
if count > 0 then
|
|
|
|
if roundend == true then
|
2016-10-13 21:59:52 +00:00
|
|
|
Message = string.format( d3stats.Message.MapStats_End, map, wins, count, wins / count * 100 )
|
2016-10-09 16:11:56 +00:00
|
|
|
else
|
2016-10-13 21:59:52 +00:00
|
|
|
Message = string.format( d3stats.Message.MapStats, map, wins, count, wins / count * 100 )
|
2016-10-09 16:11:56 +00:00
|
|
|
end
|
|
|
|
else
|
2016-10-13 21:59:52 +00:00
|
|
|
Message = string.format( d3stats.Message.MapStats_Zero, map )
|
2016-10-09 16:11:56 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
if ply then
|
|
|
|
ply:ChatPrint( Message )
|
|
|
|
else
|
|
|
|
PrintMessage( HUD_PRINTTALK, Message )
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function d3stats.Map_End( won )
|
|
|
|
local map = game.GetMap()
|
2016-10-13 21:59:52 +00:00
|
|
|
local players = #player.GetAll()
|
2016-10-09 16:11:56 +00:00
|
|
|
|
2016-10-13 21:59:52 +00:00
|
|
|
if players > 0 then
|
|
|
|
d3stats.Storage.Map_AddOutcome( map, won, players )
|
|
|
|
d3stats.Map_Message( true )
|
|
|
|
end
|
2016-10-09 16:11:56 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
--d3stats.Map_End( false )
|
|
|
|
|
|
|
|
--d3stats.Map_Message( false, player.GetByID(1) )
|