Calling function returns

So I set up my pointshop so you get points for killing Ts as innos, innos as ts, and vice versa, complete with detectives, removal of points and stuff like that.

Only thing I’ve got a problem with right now, is that you still get and get points removed for postround dm.

I tried to do it like this:



function IsMidRound()
	hook.Add("TTTBeginRound", "StartThePVP", function()
		midround = true
	end )
	hook.Add("TTTEndRound", "EndThePVP", function()
		midround = false
	end )
	return midround
end


then start the other part with



if killer:IsPlayer() && IsMidRound() then


I would also like to add a part where you get like 2 points per kill made in postround dm.



if killer:IsPlayer() && IsMidRound() == false then
	killer:PS_GivePoints(2)
	killer:PS_Notify("You've been given 2 points for killing someone postround!")
end


It works just fine if I don’t call the IsMidRound(), so I just need help getting this smalllll bit to work. Currently, nothing will happen, most likely meaning IsMidRound() is returning false, and that’s what I need help with.

I would suggest you read through TTT’s code.
[lua]
local r = GetRoundState()
if r == ROUND_POST or r == ROUND_PREP then
–do stuff
end
[/lua]

Is there a state for ROUND_MID, or something similar?


if r ~= ROUND_END and r ~= ROUND_PREP then
  --Mid round
end

ROUND_ACTIVE

These are all the variables for rounds, found in shared.lua:
[lua]
– Round status consts
ROUND_WAIT = 1
ROUND_PREP = 2
ROUND_ACTIVE = 3
ROUND_POST = 4
[/lua]