• Round end ttt gmod
    5 replies, posted
Is it possible to make it so a round doesn't end in ttt if everyone is an inno.
if you keep returning WIN_NONE in "TTTCheckForWin" hook then the round will not end, if you want to manually end it you can return WIN_TRAITOR or WIN_INNOCENT. You can also just run EndRound(WIN_INNOCENT), EndRound(WIN_TRAITOR) or EndRound(WIN_NONE)
Irrelevant to the answer but why do you want to do that?
I wanna try a free for all event with karma turned off and everyone inno
Yes it is possible. I would do this by creating a global table then a local function that would check for that round after a threshold was passed. If it was passed that use table.Random to go through and choose a random event from your global table. [CODE] CoolRounds = {} local function RoundEventCheck() local rounds = GetGlobalInt("ttt_rounds_left", 2) --Oops left an extra apostrophe if rounds <= 2 then local event = table.Random(CoolRounds) randomEvent() --Not sure if this still works? end end hook.Add("TTTBeginRound", "RoundChecker", RoundEventCheck)[/CODE] As for karma, try saving their karma to a table on the Begin Round hook and then restore it on end round?
For karma you can use this at the beginning of the round: [LUA] YourTableName.KarmaKilledFunction = KARMA.Killed KARMA.Killed = function() end YourTableName.KarmaHurtFunction = KARMA.Hurt KARMA.Hurt = function() end [/LUA] then restore them back after the round ends: [LUA] KARMA.Killed = YourTableName.KarmaKilledFunction KARMA.Hurt = YourTableName.KarmaHurtFunction [/LUA] Or you could go a little more "advanced" and do something like this after TTT has initialized: [LUA] local KilledOld = KARMA.Killed local HurtOld = KARMA.Hurt KARMA.Killed = function(...) if !BlockKarma then KilledOld(...) end end KARMA.Hurt = function(...) if !BlockKarma then HurtOld(...) end end [/LUA]
Sorry, you need to Log In to post a reply to this thread.