Jump to content

even teams


twiti

Recommended Posts

Hi guys,

 

I got a question: is it possible to configure server running silent 0.6.1 to keep teams even by numbers?

Current settings:

 

omnibot_enable 1

g_teamforcebalance 1

g_playerCounting 13

g_unevenTeamDiff 2

g_unevenTeamFreq 30

 

Problem is that players are able to join team with more players from spec(limbo or /team).

Is there any way to prevent that?

I also tried etpub lua script http://etpub.org/viewtopic.php?f=10&t=45, it didnt work.

Thanks in advance for any info :D

Link to comment
Share on other sites

  • 1 month later...

Hello silent devs and all ppl around here...

first ...sorry for my english...

and .. i have a lua script active like 1 year on our silent server..and its works...if 1 team have 2 or more players avantage ...the script moves first plwyer who die from oponent team....i share whit you and i hope is help..credits for this script go to DMG Deevious

 

-- [ Local Functions ]
function GetPlayerGUID(client)
  local player_guid = et.Info_ValueForKey(et.trap_GetUserinfo(client), "sil_guid" )
  if player_guid == "NO_GUID" or player_guid == "unknown" then 
    return true
  end
  return player_guid
end

function GetPlayerName(client)
  return et.Q_CleanStr(et.gentity_get(client, "pers.netname"))
end


-- [ Wolf Callbacks ]
function et_InitGame(levelTime,randomSeed,restart)
  et.RegisterModname("DMG Team Balance #1")
  
  players = { }
  players[0] = 0 --all
  players[1] = 0 --axis
  players[2] = 0 --allies
  players[3] = 0 --spectators
end


function et_ShutdownGame(restart)
  -- nimic
end

function et_Obituary(client, killer, death)
  local player_guid = GetPlayerGUID(client)
  local player_name = GetPlayerName(client)
  local game_state = tonumber(et.trap_Cvar_Get("gamestate"))
  local player_team = et.gentity_get(client, "sess.SessionTeam")

  if player_guid == nil then
    return nil
  end
  
  if game_state ~= 1 and game_state ~= 2 then

    players[0] = 0 --all
    players[1] = 0 --axis
    players[2] = 0 --allies
    players[3] = 0 --spectators

    for i=0, tonumber(et.trap_Cvar_Get("sv_maxclients"))-1, 1 do
      local teamnumber = tonumber(et.gentity_get(i,"sess.sessionTeam"))

      if et.gentity_get(i,"pers.connected") ~= 2 then
      else
        players[0] = players[0] + 1
        players[teamnumber] = players[teamnumber] + 1
      end
    end

    if (( (players[1] - players[2]) > 1 and player_team == 1 ) or ( (players[2] - players[1]) > 1 and player_team == 2 )) then
      -- Axis > allies si player la axis sau allies > axis si player la axis
      if player_team == 1 then
        -- player la axis - mut la allies
        et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. player_name .. " b")
      else
        -- player la allies - mut la axis
        et.trap_SendConsoleCommand( et.EXEC_APPEND, "putteam " .. player_name .. " r")
      end
      et.G_globalSound( "sound/loudness/teams.wav" )
      et.trap_SendServerCommand(-1, "chat \"^1URAAA...^8 FII FERICIT ,^7 " .. player_name .. " ^8SERVERUL TE-A ^1SACRIFICAT ^8SI MUTAT IN SPIRITUL FAIRPLAY-ULUI! ^0DMG ^4FAIRPLAY ^8SCRIPT IN ACTION ... \"")
      et.G_globalSound( "sound/loudness/hurrah.wav" )
    end
  end

  return nil
end

 

 

is not perfect but teams are always even visualy(number of players) ....and now i need help to make a function or condition...i want to capture in lua the !howfair result...and use in script like condition....

tks..

 

btw - you must moodify this line for your server ..write anything you want there..and the sound :)

 

et.trap_SendServerCommand(-1, "chat \"^1You have been moved  ,^7 " .. player_name .. " ^8tks for being fairplay \"")

enjoy

Link to comment
Share on other sites

this script will move bots...is only about number of players...but...fair teams is not mean 6vs6...can be 4bots+ 2 players vs 6 players and real playes cry...i need some help to get info about teams in lua...if teams are even(!howfair result)  the script to be passive ...or to move last connected player...

 

maybe other admins,lua programers will read this topic....and will help ..we have the server in one shity country ....all want fairplay but from others..nobody give a shit...so...we need a script like this...but more advanced...sometime...1 player is moved manny times...not so good...and is not so even..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...