Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: force join team

  1. #1

    Default force join team

    hey guys this is another post for how to make a client force join team without waiting the-
    "Team Switch Delay"
    set g_teamswitchdelay 101

    i have the code but cant understand it becouse it need a scr

    join_team axis
    setcvar "g_teamswitchdelay" "0"

    join_team axis
    wait 0.5
    setcvar "g_teamswitchdelay" "3"
    setcvar "g_teamswitchdelay" "101"

    //**//

    join_team allies
    setcvar "g_teamswitchdelay" "0"

    join_team allies
    wait 0.5
    setcvar "g_teamswitchdelay" "3"
    setcvar "g_teamswitchdelay" "101"
    and the scr will add in dmprecach

    everything here is ok ?

  2. #2

    Default

    g_teamswitchdelay doesn't work in mohaa, there are many server.cfg in internet that have it added wrongly
    however, you can use the reborn command teamswitchdelay in your DMprecache for that

    like this:

    teamswitchdelay 0.2; // you have to wait 0.2 seconds until you can change team again

  3. #3

    Default

    If you remove the switchdelay someone can crash your server.

    @Zappa: He use the SH server so the switchdelay cvar works.

    This is the script to switch the player:

    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))
    {

    local.player iprint "You have been forced to switch teams!"

    if(local.player.dmteam == "allies")
    {

    local.player join_team axis

    }
    else if (local.player.dmteam == "axis")
    {

    local.player join_team allies

    }

    setcvar switch ""

    }

    }

    }
    }

    end



    Use the command like this:

    Code:
    rcon switch 3
    Last edited by DoubleKill; August 24th, 2018 at 02:47 AM.

  4. #4

    Default

    oh i see, i think we need a new forum section for SH and BT to avoid confusion

  5. #5

    Default

    Quote Originally Posted by DoubleKill View Post
    If you remove the switchdelay someone can crash your server.

    @Zappa: He use the SH server so the switchdelay cvar works.

    This is the script to switch the player:

    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))
    {

    local.player iprint "You have been forced to switch teams!"

    if(local.player.dmteam == "allies")
    {

    local.player join_team axis

    }
    else if (local.player.dmteam == "axis")
    {

    local.player join_team allies

    }

    setcvar switch ""

    }

    }

    }
    }

    end



    Use the command like this:

    Code:
    rcon switch 3
    now i add this scr in teams.scr in my mod and add in dmprecach
    "exec global/teams.scr"
    but not working
    rcon switch **
    rcon set fst_action **|allies or axis
    rcon join_team allies or axis **
    no command work
    and still the client must stay 101s
    Last edited by Old Fox; March 25th, 2019 at 10:25 PM.

  6. #6

    Default

    The script only switch a player not a entire team.

    For example if you whant to change the player with the number 3 you do:

    Code:
    rcon switch 3
    And to remove the waiting time to switch you put g_teamswitchdelay to 0.
    Last edited by DoubleKill; August 25th, 2018 at 03:10 AM.

  7. #7

    Default

    Quote Originally Posted by DoubleKill View Post
    The script only switch a player not a entire team.

    For example if you whant to change the player with the number 3 you do:

    Code:
    rcon switch 3
    And to remove the waiting time to switch you put g_teamswitchdelay to 0.
    then i dont need the scr becouse i can make it from the command like:
    rcon password **** ;rcon teamswitchdelay 0;rcon switch 3;rcon teamswitchdelay 101

    now the players cant replace teams and must wait 101 s and thats good for me
    and my command to force them is "rcon set fst_action 3|allies"
    if i make this commaned the player will go apect and then will wait the 101s and thats bad
    Last edited by Old Fox; August 25th, 2018 at 06:33 AM.

  8. #8

    Default

    he wants to keep the 120 seconds delay but when he forces someone to switch team it should bypass the delay.

    so probably a script or execusing is needed that will first apply the 0 seconds delay... than switches player than putt back the 120 seconds wait time.

    so probably he can make a .scr file and exec it in console with these commands init?

  9. #9

    Default

    Quote Originally Posted by Slimbips {sfx} View Post
    he wants to keep the 120 seconds delay but when he forces someone to switch team it should bypass the delay.

    so probably a script or execusing is needed that will first apply the 0 seconds delay... than switches player than putt back the 120 seconds wait time.

    so probably he can make a .scr file and exec it in console with these commands init?
    This way will work:


    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))
    {

    local.player iprint "You have been forced to switch teams!"

    if(local.player.dmteam == "allies")
    {
    setcvar g_switchdelay 0
    wait 0.5
    local.player join_team axis
    wait 0.5
    setcvar g_switchdelay 101
    }
    else if (local.player.dmteam == "axis")
    {

    local.player join_team allies

    }

    setcvar switch ""

    }

    }

    }
    }

    end

  10. #10

    Default

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

Posting Permissions

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