Gamemode.OnRoundEnd

From GMod Wiki

(Redirected from OnRoundEnd)
Jump to: navigation, search
Event Hook
Hook NameOnRoundEnd
SyntaxGM:OnRoundEnd( Number round_number )
DescriptionCalled at the end of a round
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.OnRoundEnd]Gamemode.OnRoundEnd [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPuts a message in chat saying who won. Note: Assumes that you used a team based round end (see RoundEndWithResult).
Used onNewerServer.png
Code
 
function printWinner(round)
	local txt = team.GetName(GetGlobalInt("RoundResult")) .. " won round " .. tostring(round)
	for i, ply in pairs(player.GetAll()) do
		ply:ChatPrint(txt)
	end
end
hook.Add("OnRoundEnd", printWinner)
 
OutputSee the code...


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox