Jump to content

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

balance.lua + sound

- - - - - balance sounds

  • Please log in to reply
16 replies to this topic

#1
OFFLINE   Meva

Meva

    Member

  • Members
  • PipPip
  • 20 posts
4
A step in the right direction

Hi, guys :)

I have balance.lua script and it work yes, but I wanted to add sounds "player move to axis/allies". 

 

modname = "balance"

version = "0.1"
 
function et_InitGame(levelTime,randomSeed,restart)
et.RegisterModname(modname .. " " .. version)
end
 
unevenDiff = 2
max_unevenTime = 15
max_unevenDiff = 4
 
axisPlayers = {}
alliedPlayers = {}
unevenTime = 15
 
function et_RunFrame( levelTime )
   local numAlliedPlayers = table.getn( alliedPlayers )
   local numAxisPlayers = table.getn( axisPlayers )
   if numAlliedPlayers >= numAxisPlayers + max_unevenDiff then
      local clientNum = alliedPlayers[ numAlliedPlayers ]
      et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. " r" )
      et.trap_SendConsoleCommand( et.EXEC_APPEND, "playsound playermove.wav\n" )
      et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^1AXIS\"" ) 
   elseif numAxisPlayers >= numAlliedPlayers + max_unevenDiff then
      local clientNum = axisPlayers[ numAxisPlayers ]
      et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. " b" )
et.trap_SendConsoleCommand( et.EXEC_APPEND, "playsound playermove.wav\n" )
 et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^4ALLIES\"" ) 
   elseif numAlliedPlayers >= numAxisPlayers + unevenDiff then
      if unevenTime > 0 then
         if tonumber( levelTime ) - unevenTime >= max_unevenTime * 1000 then
            local clientNum = alliedPlayers[ numAlliedPlayers ]
            et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. " r" )
et.trap_SendConsoleCommand( et.EXEC_APPEND, "playsound playermove.wav\n" )
et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^1AXIS\"" ) 
         end
      else
         unevenTime = tonumber( levelTime )
      end
   elseif numAxisPlayers >= numAlliedPlayers + unevenDiff then
      if unevenTime > 0 then
         if tonumber( levelTime ) - unevenTime >= max_unevenTime * 1000 then
            local clientNum = axisPlayers[ numAxisPlayers ]
            et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. " b" )
et.trap_SendConsoleCommand( et.EXEC_APPEND, "playsound playermove.wav\n" )
et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^4ALLIES\"" ) 
         end
      else
         unevenTime = tonumber( levelTime )
      end
   else
      unevenTime = -1
   end
end
 
function et_ClientSpawn( clientNum, revived, teamChange, restoreHealth )
   if teamChange ~= 0 then
      local team = tonumber( et.gentity_get( clientNum, "sess.sessionTeam" ) )
      -- these were the teamnumbers prior to the move
      local numAlliedPlayers = table.getn( alliedPlayers )
      local numAxisPlayers = table.getn( axisPlayers )
      if team == 1 then
         for i, num in ipairs( alliedPlayers ) do
            if num == clientNum then
               table.remove( alliedPlayers, i )
               break
            end
         end
         -- this should not happen but still check for it to avoid doubles
         for i, num in ipairs( axisPlayers ) do
            if num == clientNum then
               return
            end
         end
         -- make sure a player who (got) moved when teams were uneven doesn't get moved right back
         if numAlliedPlayers >= numAxisPlayers + unevenDiff then
            table.insert( axisPlayers, 1, clientNum )
         else
            table.insert( axisPlayers, clientNum )
         end
      elseif team == 2 then
         for i, num in ipairs( axisPlayers ) do
            if num == clientNum then
               table.remove( axisPlayers, i )
               break
            end
         end
         for i, num in ipairs( alliedPlayers ) do
            if num == clientNum then
               return
            end
         end
         if numAxisPlayers >= numAlliedPlayers + unevenDiff then
            table.insert( alliedPlayers, 1, clientNum )
         else
            table.insert( alliedPlayers, clientNum )
         end
      else
         for i, num in ipairs( alliedPlayers ) do
            if num == clientNum then
               table.remove( alliedPlayers, i )
               return
            end
         end
         for i, num in ipairs( axisPlayers ) do
            if num == clientNum then
               table.remove( axisPlayers, i )
               return
            end
         end
      end
   end
end
 
function et_ClientDisconnect( clientNum )
   for i, num in ipairs( alliedPlayers ) do
      if num == clientNum then
         table.remove( alliedPlayers, i )
         return
      end
   end
   for i, num in ipairs( axisPlayers ) do
      if num == clientNum then
         table.remove( axisPlayers, i )
         return
      end
   end
end

And doesn't work :< I'm put on other team but can not hear sound... please help me :<


Edited by Meva, 22 September 2014 - 04:06 PM.


#2
OFFLINE   Dragonji

Dragonji

    Advanced Member

  • Members
  • PipPipPipPip
  • 514 posts
142
On the road to fame
  • LocationPoland
Use this instead: http://mygamingtalk....a#G_globalSound

et.G_globalSound("playermove.wav")

Edited by Dragonji, 22 September 2014 - 04:40 PM.


#3
OFFLINE   Meva

Meva

    Member

  • Members
  • PipPip
  • 20 posts
4
A step in the right direction

ok it work! :) thank you!



#4
OFFLINE   Sentrosii

Sentrosii

    Newbie

  • Members
  • Pip
  • 12 posts
0
Unknown

Hello,

I know that this is topic about sound in ballance cfg, but i have question about cfg balance so i think that this subject is correct.

 

Is it possible to balance team only to 12 lvl? I mean, i want to balance all players without admins over 12 lvl.

 



#5
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better

Hello,

I know that this is topic about sound in ballance cfg, but i have question about cfg balance so i think that this subject is correct.

 

Is it possible to balance team only to 12 lvl? I mean, i want to balance all players without admins over 12 lvl.

Yes it is, right before you move the player, check to see if their level is 12 or higher, if its 12 or higher then return to reload the script and check again.

 if et.G_shrubbot_level(_clientNum) >= 12 then return end

Edited by Purple, 09 October 2014 - 07:11 PM.


#6
OFFLINE   Sentrosii

Sentrosii

    Newbie

  • Members
  • Pip
  • 12 posts
0
Unknown

Thanks it really help me out.

One more think.

 

When i need to put this cmd? Because there is few places where is putteam.



#7
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better

Thanks it really help me out.

One more think.

 

When i need to put this cmd? Because there is few places where is putteam.

 
modname = "balance"
version = "0.1"
 
function et_InitGame(levelTime,randomSeed,restart)
	et.RegisterModname(modname .. " " .. version)
end
 
unevenDiff = 2
max_unevenTime = 15
max_unevenDiff = 4
 
axisPlayers = {}
alliedPlayers = {}
unevenTime = 15
 
function et_RunFrame( levelTime )
	local numAlliedPlayers = table.getn( alliedPlayers )
	local numAxisPlayers = table.getn( axisPlayers )
		if numAlliedPlayers >= numAxisPlayers + max_unevenDiff then
			if et.G_shrubbot_level(clientNum) >= 12 then return end
			local clientNum = alliedPlayers[ numAlliedPlayers ]
			et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. " r" )
			et.trap_SendConsoleCommand( et.EXEC_APPEND, "playsound playermove.wav\n" )
			et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^1AXIS\"" ) 
		elseif numAxisPlayers >= numAlliedPlayers + max_unevenDiff then
			if et.G_shrubbot_level(clientNum) >= 12 then return end
			local clientNum = axisPlayers[ numAxisPlayers ]
			et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. " b" )
			et.trap_SendConsoleCommand( et.EXEC_APPEND, "playsound playermove.wav\n" )
			et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^4ALLIES\"" ) 
		elseif numAlliedPlayers >= numAxisPlayers + unevenDiff then
		if unevenTime > 0 then
			if tonumber( levelTime ) - unevenTime >= max_unevenTime * 1000 then
				if et.G_shrubbot_level(clientNum) >= 12 then return end
				local clientNum = alliedPlayers[ numAlliedPlayers ]
				et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. " r" )
				et.trap_SendConsoleCommand( et.EXEC_APPEND, "playsound playermove.wav\n" )
				et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^1AXIS\"" ) 
			end
		else
			unevenTime = tonumber( levelTime )
		end
		
		elseif numAxisPlayers >= numAlliedPlayers + unevenDiff then
			if unevenTime > 0 then
				if et.G_shrubbot_level(clientNum) >= 12 then return end
				if tonumber( levelTime ) - unevenTime >= max_unevenTime * 1000 then
					local clientNum = axisPlayers[ numAxisPlayers ]
					et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. " b" )
					et.trap_SendConsoleCommand( et.EXEC_APPEND, "playsound playermove.wav\n" )
					et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^4ALLIES\"" ) 
			end
			else
				unevenTime = tonumber( levelTime )
			end
		else
			unevenTime = -1
   end
end
 
function et_ClientSpawn( clientNum, revived, teamChange, restoreHealth )
   if teamChange ~= 0 then
      local team = tonumber( et.gentity_get( clientNum, "sess.sessionTeam" ) )
      -- these were the teamnumbers prior to the move
      local numAlliedPlayers = table.getn( alliedPlayers )
      local numAxisPlayers = table.getn( axisPlayers )
      if team == 1 then
         for i, num in ipairs( alliedPlayers ) do
            if num == clientNum then
               table.remove( alliedPlayers, i )
               break
            end
         end
         -- this should not happen but still check for it to avoid doubles
         for i, num in ipairs( axisPlayers ) do
            if num == clientNum then
               return
            end
         end
         -- make sure a player who (got) moved when teams were uneven doesn't get moved right back
         if numAlliedPlayers >= numAxisPlayers + unevenDiff then
            table.insert( axisPlayers, 1, clientNum )
         else
            table.insert( axisPlayers, clientNum )
         end
      elseif team == 2 then
         for i, num in ipairs( axisPlayers ) do
            if num == clientNum then
               table.remove( axisPlayers, i )
               break
            end
         end
         for i, num in ipairs( alliedPlayers ) do
            if num == clientNum then
               return
            end
         end
         if numAxisPlayers >= numAlliedPlayers + unevenDiff then
            table.insert( alliedPlayers, 1, clientNum )
         else
            table.insert( alliedPlayers, clientNum )
         end
      else
         for i, num in ipairs( alliedPlayers ) do
            if num == clientNum then
               table.remove( alliedPlayers, i )
               return
            end
         end
         for i, num in ipairs( axisPlayers ) do
            if num == clientNum then
               table.remove( axisPlayers, i )
               return
            end
         end
      end
   end
end
 
function et_ClientDisconnect( clientNum )
   for i, num in ipairs( alliedPlayers ) do
      if num == clientNum then
         table.remove( alliedPlayers, i )
         return
      end
   end
   for i, num in ipairs( axisPlayers ) do
      if num == clientNum then
         table.remove( axisPlayers, i )
         return
      end
   end
end


#8
OFFLINE   Sentrosii

Sentrosii

    Newbie

  • Members
  • Pip
  • 12 posts
0
Unknown

Hm it didnt work.

I dont know, maybe this

     end

  end

end

is not nessesary? Could someone give me an answer of that problem?

Thanks a lot.


Edited by Sentrosii, 18 October 2014 - 05:23 PM.


#9
OFFLINE   Meva

Meva

    Member

  • Members
  • PipPip
  • 20 posts
4
A step in the right direction

maybe now it work:

 

 

 

modname = "balance"
version = "0.1"

function et_InitGame(levelTime,randomSeed,restart)
    et.RegisterModname(modname .. " " .. version)
end

unevenDiff = 2
max_unevenTime = 15
max_unevenDiff = 4

axisPlayers = {}
alliedPlayers = {}
unevenTime = 15

function et_RunFrame( levelTime )
    local numAlliedPlayers = table.getn( alliedPlayers )
    local numAxisPlayers = table.getn( axisPlayers )
        if numAlliedPlayers >= numAxisPlayers + max_unevenDiff then
            if et.G_shrubbot_level(clientNum) >= 12 then return end
            local clientNum = alliedPlayers[ numAlliedPlayers ]
            et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. " r" )
            et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^1AXIS\"" )
        elseif numAxisPlayers >= numAlliedPlayers + max_unevenDiff then
            if et.G_shrubbot_level(clientNum) >= 12 then return end
            local clientNum = axisPlayers[ numAxisPlayers ]
            et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. " b" )
            et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^4ALLIES\"" )
        elseif numAlliedPlayers >= numAxisPlayers + unevenDiff then
        if unevenTime > 0 then
            if tonumber( levelTime ) - unevenTime >= max_unevenTime * 1000 then
                if et.G_shrubbot_level(clientNum) >= 12 then return end
                local clientNum = alliedPlayers[ numAlliedPlayers ]
                et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. " r" )
                et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^1AXIS\"" )
            end
        else
            unevenTime = tonumber( levelTime )
        end
        
        elseif numAxisPlayers
>= numAlliedPlayers + unevenDiff then
            if unevenTime > 0 then
                if et.G_shrubbot_level(clientNum) >= 12 then return end
                if tonumber( levelTime ) - unevenTime >= max_unevenTime * 1000 then
                    local clientNum = axisPlayers[ numAxisPlayers ]
                    et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. " b" )
                    et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^4ALLIES\"" )
            end
            else
                unevenTime = tonumber( levelTime )
            end
        else
            unevenTime = -1
end
end

function et_ClientSpawn( clientNum, revived, teamChange, restoreHealth )
if teamChange ~= 0 then
local team = tonumber( et.gentity_get( clientNum, "sess.sessionTeam" ) )
-- these were the teamnumbers prior to the move
local numAlliedPlayers = table.getn( alliedPlayers )
local numAxisPlayers = table.getn( axisPlayers )
if team == 1 then
for i, num in ipairs( alliedPlayers ) do
if num == clientNum then
table.remove( alliedPlayers, i )
break
end
end
-- this should not happen but still check for it to avoid doubles
for i, num in ipairs( axisPlayers ) do
if num == clientNum then
return
end
end
-- make sure a player who (got) moved when teams were uneven doesn't get moved right back
if numAlliedPlayers >= numAxisPlayers + unevenDiff then
table.insert( axisPlayers, 1, clientNum )
else
table.insert( axisPlayers, clientNum )
end
elseif team == 2 then
for i, num in ipairs( axisPlayers ) do
if num == clientNum then
table.remove( axisPlayers, i )
break
end
end
for i, num in ipairs( alliedPlayers ) do
if num == clientNum then
return
end
end
if numAxisPlayers >= numAlliedPlayers + unevenDiff then
table.insert( alliedPlayers, 1, clientNum )
else
table.insert( alliedPlayers, clientNum )
end
else
for i, num in ipairs( alliedPlayers ) do
if num == clientNum then
table.remove( alliedPlayers, i )
return
end
end
for i, num in ipairs( axisPlayers ) do
if num == clientNum then
table.remove( axisPlayers, i )
return
end
end
end
end
end

function et_ClientDisconnect( clientNum )
for i, num in ipairs( alliedPlayers ) do
if num == clientNum then
table.remove( alliedPlayers, i )
return
end
end
for i, num in ipairs( axisPlayers ) do
if num == clientNum then
table.remove( axisPlayers, i )
return
end
end
end


#10
OFFLINE   Sentrosii

Sentrosii

    Newbie

  • Members
  • Pip
  • 12 posts
0
Unknown

Eh no, it's still not working. I'll try this all and nothing.

Could you correct this somehow? Maybe you could figure it out what could be wrong in this cmd.

 

Thanks a lof for this all replays:)



#11
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better

Eh no, it's still not working. I'll try this all and nothing.

Could you correct this somehow? Maybe you could figure it out what could be wrong in this cmd.

 

Thanks a lof for this all replays:)

Do me a favor. fill this out and let me know.

 

Mod:

version:

Did you include the file in your server config?(lua_modules "name.lua":

What is your problem?:



#12
OFFLINE   Pixelowy

Pixelowy

    Newbie

  • Members
  • Pip
  • 3 posts
0
Unknown

Our(Mine and Sentrosii) mod is silent 0.8.3 We would like to have autobalance option in our server. Our problem is in adminlevel. We would like to have a script which move all players without adminlvl >= 12. We would be very grateful if someone would help us write it. Sorry for my English :)


Edited by Pixelowy, 25 November 2014 - 02:25 PM.


#13
OFFLINE   Petbark

Petbark

    Advanced Member

  • Members
  • PipPipPipPip
  • 185 posts
30
Getting Better

Our(Mine and Sentrosii) mod is silent 0.8.3 We would like to have autobalance option in our server. Our problem is in adminlevel. We would like to have a script which move all players without adminlvl >= 12. We would be very grateful if someone would help us write it. Sorry for my English :)

Interesting I did not know that 8.3 was around.

 

I am only aware of 8.2.



#14
OFFLINE   Pixelowy

Pixelowy

    Newbie

  • Members
  • Pip
  • 3 posts
0
Unknown

ohh it's my mistake. I mean 0.8.2



#15
OFFLINE   Purple

Purple

    Advanced Member

  • Banned
  • PipPipPipPip
  • 157 posts
56
Getting Better

We have posted the script multiple times, yet you haven't managed to give us a probable cause to why its not working. I'm not sure what you want us to do here.



#16
OFFLINE   Pixelowy

Pixelowy

    Newbie

  • Members
  • Pip
  • 3 posts
0
Unknown

It is not working because it does not move player with admin level <12 to the other team.



#17
OFFLINE   TheSilencerPL

TheSilencerPL

    Advanced Member

  • Management
  • PipPipPipPip
  • 3099 posts
216
On the road to fame
  • LocationPoland

Fixed version. I've fixed it for Pixelowy on his request, but I will share it here, so that everyone can have some use of it.

modname = "balance"
version = "0.2"
 
function et_InitGame(levelTime,randomSeed,restart)
	et.RegisterModname(modname .. " " .. version)
end
 
unevenDiff = 2
max_unevenTime = 15
max_unevenDiff = 4
 
axisPlayers = {}
alliedPlayers = {}
unevenTime = 15
immuneLvl = 12

function putTeam(clientNum, team)
	if clientNum == -1 then return end

	local teamStr
	if ( team == "AXIS" ) then
		teamStr = " r"
	else
		teamStr = " b"
	end
		
	et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. clientNum .. teamStr )
	et.trap_SendConsoleCommand( et.EXEC_APPEND, "playsound playermove.wav\n" )
	et.trap_SendServerCommand(-1, "chat \"balancing teams... " .. et.gentity_get( clientNum, "pers.netname" ) .. "^7 moved to ^1" .. team .. "\"" ) 
end	

function longEnough(levelTime)
	return (tonumber(levelTime) - unevenTime >= max_unevenTime * 1000)
end

-- check if the level can be moved
function goodLevel(clientNum)
	return ( et.G_shrubbot_level(clientNum) < immuneLvl)
end

-- pick player from the team specified by the parameter
-- pick only players with lower than immuneLvl level
-- return -1 if not found
function pickPlayer(team)
	if team == "AXIS" then
		for clientNum = #axisPlayers,1,-1 do
			if goodLevel(axisPlayers[clientNum]) then
				return axisPlayers[clientNum]
			end
        	end
	else
		for clientNum = #alliedPlayers,1,-1 do
			if goodLevel(alliedPlayers[clientNum]) then
				return alliedPlayers[clientNum]
			end
        	end
	end

	-- not found -- all higher admins?
	return -1
end

function pickFromAndMove(from, to)
	local clientNum = pickPlayer(from)
	putTeam(clientNum, to)
end


function et_RunFrame( levelTime )
	local numAlliedPlayers = table.getn( alliedPlayers )
	local numAxisPlayers = table.getn( axisPlayers )
	
	if numAlliedPlayers >= numAxisPlayers + max_unevenDiff then
		pickFromAndMove("ALLIES", "AXIS")
	elseif numAxisPlayers >= numAlliedPlayers + max_unevenDiff then
		pickFromAndMove("AXIS", "ALLIES")	
	elseif numAlliedPlayers >= numAxisPlayers + unevenDiff then
		if unevenTime > 0 then
			if longEnough(levelTime) then
				pickFromAndMove("ALLIES", "AXIS")
			end
		else
			unevenTime = tonumber( levelTime )
		end
	elseif numAxisPlayers >= numAlliedPlayers + unevenDiff then
		if unevenTime > 0 then
			if longEnough(levelTime) then
				pickFromAndMove("AXIS", "ALLIES")
			end
		else
			unevenTime = tonumber( levelTime )
		end
	else
		unevenTime = -1
   	end
end
 
function et_ClientSpawn( clientNum, revived, teamChange, restoreHealth )
   if teamChange ~= 0 then
      local team = tonumber( et.gentity_get( clientNum, "sess.sessionTeam" ) )
      -- these were the teamnumbers prior to the move
      local numAlliedPlayers = table.getn( alliedPlayers )
      local numAxisPlayers = table.getn( axisPlayers )
      if team == 1 then
         for i, num in ipairs( alliedPlayers ) do
            if num == clientNum then
               table.remove( alliedPlayers, i )
               break
            end
         end
         -- this should not happen but still check for it to avoid doubles
         for i, num in ipairs( axisPlayers ) do
            if num == clientNum then
               return
            end
         end
         -- make sure a player who (got) moved when teams were uneven doesn't get moved right back
         if numAlliedPlayers >= numAxisPlayers + unevenDiff then
            table.insert( axisPlayers, 1, clientNum )
         else
            table.insert( axisPlayers, clientNum )
         end
      elseif team == 2 then
         for i, num in ipairs( axisPlayers ) do
            if num == clientNum then
               table.remove( axisPlayers, i )
               break
            end
         end
         for i, num in ipairs( alliedPlayers ) do
            if num == clientNum then
               return
            end
         end
         if numAxisPlayers >= numAlliedPlayers + unevenDiff then
            table.insert( alliedPlayers, 1, clientNum )
         else
            table.insert( alliedPlayers, clientNum )
         end
      else
         for i, num in ipairs( alliedPlayers ) do
            if num == clientNum then
               table.remove( alliedPlayers, i )
               return
            end
         end
         for i, num in ipairs( axisPlayers ) do
            if num == clientNum then
               table.remove( axisPlayers, i )
               return
            end
         end
      end
   end
end
 
function et_ClientDisconnect( clientNum )
   for i, num in ipairs( alliedPlayers ) do
      if num == clientNum then
         table.remove( alliedPlayers, i )
         return
      end
   end
   for i, num in ipairs( axisPlayers ) do
      if num == clientNum then
         table.remove( axisPlayers, i )
         return
      end
   end
end






Also tagged with one or more of these keywords: balance, sounds

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users