[Support] GSC: Spectators?

Topic created · 4 Posts · 53 Views
  • 
    checkAllowSpectating()
    {
    wait ( 0.05 );
    
    update = false;
    if ( !level.aliveCount[ game["attackers"] ] )
    {
    level.spectateOverride[game["attackers"]].allowEnemySpectate = 1;
    update = true;
    }
    if ( !level.aliveCount[ game["defenders"] ] )
    {
    level.spectateOverride[game["defenders"]].allowEnemySpectate = 1;
    update = true;
    }
    if ( update )
    maps\mp\gametypes\_spectating::updateSpectateSettings();
    }
    
    

    -If I wanted to set spectators to an automatic team, axis or allies, would this be the right code to do it, I think It’s not?

  • If you don't know if it's the right/wrong code for it: test it.

  • @Farzad what is your code? the code to go in spectator mode?
    Use this to go in spectator mode

    goInSpectator(){
        self maps\mp\gametypes\_spectating::setSpectatePermissions();
        self allowSpectateTeam( "freelook", true );
        self.sessionstate = "spectator";
    }
    
  • @Sorex With SnD, you can’t just spawn in if you connect late and the round has started.. I’m looking to auto set any spectators (people who connect late to the round and can’t spawn in) to allies or axis

Log in to reply