Jump to content

PDK

Ets|Members
  • Posts

    38
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by PDK

  1. On 9/6/2022 at 1:44 AM, Vixda said:

    I guess that there is a way to balance the team by code. Reading some forums I find this:

    modname = "balance"
    version = "0.1"
     
    function et_InitGame(levelTime,randomSeed,restart)
    et.RegisterModname(modname .. " " .. version)
    end
     
    unevenDiff = 2
    max_unevenTime = 45
    max_unevenDiff = 4
     
    axisPlayers = {}
    alliedPlayers = {}
    unevenTime = 15
    function isBot(clientNum)
       if et.gentity_get(clientNum,"ps.ping") == 0 then
           return true -- is Bot
       end
    end
    
    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.G_globalSound("lua/playermove.wav")
     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.G_globalSound("lua/playermove.wav")
     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.G_globalSound("lua/playermove.wav")
    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.G_globalSound("lua/playermove.wav")
    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
    		 	if isBot(clientNum) then 
    				--do nothing
    			else
    				table.insert( axisPlayers, clientNum )
    			end
             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
    			if isBot(clientNum) then 
    				--do nothing
    			else
    				table.insert( alliedPlayers, clientNum )
    			end
             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

     

    nice work bro !

    • Like 1
  2. 1 minute ago, JET SLOOTMAEKERS said:

    its was my fault too, i didnt ask, but today, 16:55 brazilian time, i ask for ,  cartum and hal, they didn't want to even teams, 

    hello it was me who was in the game and who was talking with you...

    don't be so strict, you could see that it bothered no one during the game, it was me who wanted to go to the axis, and after others joined me... so the even team was not necessary

    since everyone was ok ...

    you came you played 2 min and immediately ask even team ... without knowing if it was wanted  ...

    nobody left the game exept u and me ...

    but basically you're right of course, the rule is this one, but sometimes it's wanted

  3. It's actually a recurring topic...
    I've seen a lot of players leave the server when they get killed (odin for example), even if they're on the best team...
    personally I like to play alone against everyone and I'm not the only one...
    do not confuse "even team" and "rage quitt"

    • Like 2
    • Haha 1
  4. here are some pictures of a spindle from a forging machine.

    I spray a fluorescent spray, then I magnetize it so that the magnetic field deposits magnetic liquor on the cracks or other defects ...

    then I put the environment under UVA black light, to see the cracks

    IMG_20211125_174927_373.jpg

    IMG_20211125_183744_272.jpg

    IMG_20211125_183754_225.jpg

    • Like 4
  5. 20 hours ago, Bier said:

    The company I work for is also in the metal business. We import/export welding wires, rods, ceramics and safety items for the metal processing industry like builders, shipyards, manufacurers, etc...

    We also offer some annealing equipment for rental, resistance and induction based.
    It's a very important process for some manufacturing steps, and with the new high-tech base materials it gets even more important so your future is bright! ;-)
    But do I know anything more about metal? No! I run the IT department there.... Hahaha!

    And damn! Working for F1! That would look great on my CV too!

    ahahah cool you're a metallist too :) ...
    I see exactly what your job is :).
    so I will add a precision to mine ^^:
    the quenching furnace is gas (water / polymer and air quenching)
    and my tempering furnace is electric,
    sometimes I take care of an annealing furnace which operates under vacuum with nitrogen.
    so I make different steels:
    -super alloy for aeronautics.
    -HSS steel for cutting tools.
    -aluminum tubes for jet fighters .
    -and for 2 and a half years, titanium (dentist, surgery, car parts).
    -and zirconium (very hard to work).
    Of course everything that is control hardness / pyrometry control / geometry control ...
    
    • Like 1
  6. On 9/29/2021 at 2:31 PM, Tutox said:

    Wooow your job sounds awesome man, for me instead, i'm a Sociologist, and what I do is basically, make statistical reports of social projects hahaha Your job is wayyyy better

    THX Tutox :)

    I think your work is as essential as mine, 
    we are like the worker ants of a colony, 
    so every ants is important.
    I also think that the point of view plays a lot in the importance of the work ... 
    for example a pure ecologist would see my work negatively for sure.

    but yep i love my job

  7. hello everyone :)

    I had posted on the old site, my job.
    my job consists in treating metal parts in a heat treatment + quenching furnace and in a tempering furnace.
    I work for nuclear / military / aviation and sometimes for formula 1 / rally ...
    all the pieces I do have a minimum 40-year follow-up, so my name too ...
    I will take some photos of what I have the right to photograph, to give you an overview of my work.
    my furnaces can handle small parts up to 6 meters by 1.50 meters.

    From next week I am starting a qualification in NDT Non Destructive Control (magnetoscopy and ultrasound),

    so I will be absent for the whole week, maybe a little more.

    I will post some pictures of what this profession consists of :)

    • Like 4
×
×
  • Create New...