• Making a "win round" function
    0 replies, posted
Sorry for a kinda open end question, I want to make a win round function to be triggered by lua_run from source_SDK. Like, map > player goes into win area > triggers lua_run > winroundfunction I know how to do all of that apart from i cant understand how to make the winning round function inside the LUA. This is what i have so far which might be totally wrong: [CODE]if SERVER then util.AddNetworkString("WinsRoundHook") hook.Add("???","Inform Winner of Round", function(winner ?) net.Start("WinsRoundHook?") net.WriteString(winner:GetName()) net.Send(?????) victim:PrintMessage(HUD_PRINTCENTER,ply()??:GetName ().." has won the round\n") end) end --Clientside if CLIENT then local showWinRound = false local winner = nil net.Receive("WinsRoundHook", function(len) winner = net.ReadString() showWinRound = true timer.Simple(14, function() showWinRound = false winner = nil end) end) surface.CreateFont("winfont", { font = "coolvetica", size = 24, weight = 40000, antialias = true, shadow = false }) hook.Add("HUDPaint", "DisplayWinRoundStuff", function() if winner and showWinRound then draw.RoundedBox( 10, 2, ScrH() / 2, 375, 80, Color( 0, 0, 0, 150 ) ) draw.SimpleText("Won Round", "winfont", 5, ScrH() / 2 + 16, Color(255,255,255,255)) draw.SimpleText(winner, "winfont", 5, ScrH() / 2 + 42, Color(180,20,20,255)) end end) end[/CODE]
Sorry, you need to Log In to post a reply to this thread.