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"
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.
does admin pro work on sh?, so yes hbe can use that one
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.
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.
any new idea smithy ?
Last edited by Old Fox; September 4th, 2018 at 09:22 AM.
why wouldu force someone in spec?
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.
Last edited by Old Fox; September 6th, 2018 at 06:24 PM.
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 ?