Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 31

Thread: force join team

  1. #11

    Default

    Maybe is not recognizing the command.

    And i have type him wrong...

    Change on the script the command like this:

    Code:
    setcvar "g_teamswitchdelay" "120"

  2. #12

    Default

    Quote Originally Posted by DoubleKill View Post
    Maybe is not recognizing the command.

    And i have type him wrong...

    Change on the script the command like this:

    Code:
    setcvar "g_teamswitchdelay" "120"
    no still not running
    but ill test something


    main:

    while(1)
    {
    wait 0.02

    local.switch_player = getcvar "switch"

    if(local.switch_player != "")
    {

    for(local.i = 1;local.i <= $player.size;local.i++)
    {

    local.player = $player[local.i]

    if(local.player == NULL)
    end

    if(local.player.entnum == int(local.switch_player))
    {

    if(local.player.dmteam == "allies")
    {
    setcvar g_teamswitchdelay 0
    wait 0.5

    local.player join_team axis
    wait 2

    setcvar "g_teamswitchdelay" "120"

    local.player iprint ("TG Admin forced you to join AXIS") 1

    }
    else
    {

    if (local.player.dmteam == "axis")

    setcvar g_teamswitchdelay 0
    wait 0.5

    local.player join_team allies
    wait 2

    setcvar "g_teamswitchdelay" "120"

    local.player iprint ("TG Admin forced you to join ALLIES") 1

    }

    }

    }

    }

    end

    //***************************************************************//
    Last edited by Old Fox; March 25th, 2019 at 10:26 PM.

  3. #13

    Default

    does admin pro work on sh?, so yes hbe can use that one

  4. #14

    Default

    Make sure to indent your lines properly because it makes reading it a nightmare . There were missing and extra brackets in places. You also needed to reset the cvar afterwards.

    Try:


    main:
    while(1)
    {
    local.switch_player = getcvar "switch"
    if (local.switch_player != "")
    {
    local.original_delay = getcvar g_teamswitchdelay // store current config
    for (local.i = 1; local.i <= $player.size; local.i++)
    {
    local.player = $player[local.i]
    if (local.player.entnum == int local.switch_player)
    {
    local.team = local.player.dmteam // store current team

    if (local.team == "allies")
    local.opp_team = axis
    else if (local.team == "axis")
    local.opp_team = allies
    else
    local.opp_team = NA

    setcvar g_teamswitchdelay 0
    waitframe // is this actually needed?

    if (local.player && local.player.dmteam == local.team) // if still on the same team
    {
    if (local.opp_team != NA)
    local.player join_team local.opp_team
    else
    local.player auto_join_team // pick team with fewest players (or random)

    local.player iprint ("TG Admin forced you to join " + local.player.dmteam) 1
    }

    setcvar g_teamswitchdelay local.original_delay // set back to original
    break
    }
    }
    setcvar "switch" ""
    }
    waitframe
    }
    end
    Last edited by 1337Smithy; September 5th, 2018 at 02:43 AM.

  5. #15

    Default

    ok running now and great
    so can i force the player when he in the spect mod too ?
    and without waiting the 120s ?

    lets edit it in the same scr

    thankx
    Last edited by Old Fox; September 4th, 2018 at 09:21 AM.

  6. #16

    Default

    any new idea smithy ?
    Last edited by Old Fox; September 4th, 2018 at 09:22 AM.

  7. #17

    Default

    why wouldu force someone in spec?

  8. #18

    Default

    I've made changes. Obviously there's no opposite team if they are spec so I just used the auto_join_team command and hope that will suffice. I also removed the lengthy arbitrary waits. So make sure to copy it all again.

  9. #19

    Default

    Quote Originally Posted by Slimbips {sfx} View Post
    why wouldu force someone in spec?
    Nah slim i meant if he in spect mode he must wait 120s to can join team
    and now smithy made the client join the teams with auto balance without waiting the 120s
    And i want to force him to join any team i want from spect to team without auto balance
    thats it
    Last edited by Old Fox; September 6th, 2018 at 06:24 PM.

  10. #20

    Default

    so i need a new scr or add the codes in our scr for force join team from spect to team the admin want

    and the the command to force join team is rcon switch **
    so what the command to force join team from spect to team without waiting "teamswitchdelay 120" and without auto balance ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •