Would there be anyway to create a callback that signals everytime a player switches team.
ClientSwitchTeam(clientNum,toteam) (or maybe add (clientNum,fromTeam,toTeam) )
function et_ClientSwitchTeam( clientNum , toTeam) local currentTeam = et.gentity_get(clientNum,"sess.sessionTeam") et.G_LogPrint("Stopping " .. clientNum .. " from switching from " .. currentTeam .. " " .. toTeam .."\n") return 1 end
function et_ClientSwitchTeam( clientNum ,fromTeam, toTeam) et.G_LogPrint("Stopping " .. clientNum .. " from switching from " .. fromTeam .. " " .. toTeam .."\n") return 1 end
I can't decide which switchteams it should catch though. There is /team and the limbo menu and then there is things like inactivity, ref putallies, !putteam, and !shuffle also I think there is an automove in the killrating playerbalance thing.
I would like them all but it seems like there could be problems that could cause.
It would be nice if I could possibly return 1 like I do in ClientCommand to stop them from joining.
I had originally thought that I could basically create my own with client command (And Possibly a runframe for inactivity) but it doesn't seem like the limbo menu passes any kind of command that lua catches(Or am I wrong?)
Anyways thoughts on the idea?