MINIMAL_LEVEL_TOEXECUTE = 20 -- minimal level to execute this command
SHUFFLE_COMMAND = "!shuffle" -- shuffle command
SHUFFLE_AFTERTIME = 5*60 -- 5min
Client = { }
function et_InitGame( levelTime, randomSeed, restart )
maxclients = et.trap_Cvar_Get( "sv_maxclients" )
end
function et_ClientCommand( num, cmd )
local arg0 = string.lower(cmd)
local arg1 = string.lower(et.trap_Argv(1))
if et.G_shrubbot_level( num ) >= MINIMAL_LEVEL_TOEXECUTE and arg0 == SHUFFLE_COMMAND or arg1 == SHUFFLE_COMMAND then
StartTime = os.time()
for i = 0, maxclients - 1 do
local team = et.gentity_get(i, "sess.sessionTeam")
if team ~= 3 then
Client[i] = team
end
end
return true -- let execute it
end
if arg0 == "team" and StartTime ~= nil then
if arg1 == "b" then
if os.time() >= (StartTime + SHUFFLE_AFTERTIME) and Client[num] == 1 then
return false
end
elseif arg1 == "r" then
if os.time() >= (StartTime + SHUFFLE_AFTERTIME) and Client[num] == 2 then
return false
end
end
end
end
It is just concept but it should works, in this case they won't be able to change to ->spec-> another team too