Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google Log In with Steam Sign In
  • Create Account
Photo

g_shuffle_staytime or something?

- - - - -

  • Please log in to reply
2 replies to this topic

#1
OFFLINE   Chuckun

Chuckun

    Regular Member

  • Members
  • PipPipPip
  • 130 posts
20
On a distinguished road

I am requesting a new shuffle server cvar to prevent players from switching teams until after a predifined period of time..

 

For example, g_shuffle_staytime 300 would prevent players from switching teams until 5 minutes after any shuffle (be it via shrubbot command or auto shuffle).

 

This would be SO helpful.

 

If this were to be implemented, it should not affect !putteam, as there are occasions where people DO need to move soon after a shuffle (if a player leaves for example), but dealing with this manually would be so much better than dealing with all the team stackers we have every day..

 

Could it be implemented?

 

If you need any extra infos I will be stalking so feel free to ask :)


Edited by Chuckun, 11 October 2013 - 10:13 PM.


#2
OFFLINE   Sol

Sol

    Regular Member

  • Coders
  • PipPipPip
  • 113 posts
28
On a distinguished road
  • LocationPoland
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


Edited by solaЯ, 12 October 2013 - 12:03 AM.


#3
OFFLINE   Chuckun

Chuckun

    Regular Member

  • Members
  • PipPipPip
  • 130 posts
20
On a distinguished road
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

 

 

Sweeeet thank you :D Now to try get our server admin while he has a moment to integrate it :P


Edited by Chuckun, 12 October 2013 - 02:40 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users