Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Script to rotate cfg's?

  1. #11

    Default

    change the timelimit to trigger the map change
    the intermission event should exec the cfg's

  2. #12

    Default

    well this works, I don't care about the intermission stuff it will only run if there is no active players on server, as long as it changes each night, it works when the system clocks hits 24:00 ( had to google that shit to find out how to change it )
    Code:
      
    main:
        wait 30;
        for(local.i=1;local.i<= $player.size;local.i++)
        if(!(IsAlive $player[local.i]) || $player[local.i].dmteam == "spectator")
       
       {
           
            //iprintln "TESTING"
            waitthread date
        }
        else
        {
            end
        }
    end
    
    date:
    
        if (getcvar("_date") == "") {
            local.date = getdate(0);
            setcvar "_date" local.date;
        }
    
        while(1) {
            wait 5;
            local.new_date = getdate(0);
            if (getcvar("_date") != local.new_date)
            {
                setcvar "_date" local.new_date;
                
                stuffsrv("say It's midnight, no active players found, changing game type.\n");
                wait 10;
                waitthread rotate
                
                //local.result = unregisterev "intermission";
                //local.result = registerev "intermission" global/rotation.scr::intermission;
                
                end;
            }
           wait 5;
        }
    end;
    /*
    intermission local.type:
    
    local.type - type of server intermission
    
    // 0 = Player intermission screen
    // 1 = Map change (happens after using commands: map, gamemap , but also right after player intermission screen)
    // 2 = Map restart (happens after restart command)
    
        if (local.type == 0) {
            thread rotate;
        }
    end;
    */
    rotate:
        if(getcvar("g_gametype") == "1")
        {
            wait 1;
            stuffsrv("exec cfg/tdm.cfg");
        }
    
        else if(getcvar("g_gametype") == "2")
        {    
            wait 1;
            stuffsrv("exec cfg/rbm.cfg");
        }
    
        else if(getcvar("g_gametype") == "3")
        {
           wait 1;
            stuffsrv("exec cfg/obj.cfg");
    
        }
    
        else if(getcvar("g_gametype") == "4")
        {
            wait 1;
            stuffsrv("exec server.cfg");
        }
    end;

  3. #13

    Default

    I'm a dumb ass just found out I can do that from the server admin control panel has a place for scheduled tasks that I can set to restart server with a new command line each day...amazing of all the servers I've rented this is the first one that had this function. But I did learn something about scripting doing this so it's not a loss of time. I found a better way to do mey's cfg's instaed of doing it this way
    Code:
    if(getcvar("g_extgametype") == "rbm")
        {
            wait 1;
            stuffsrv("exec tdm.cfg");
        }
    I did it this way
    Code:
     if (level.mef_gametype == "rbm") iprintln "The gametype is Round-Based"
        {
            stuffsrv("say SWITCHING TO TEAM-MATCH\n");
            wait 3;
            stuffsrv("exec tdm.cfg");
        }
    found that when I was looking thru mefy's folders current_gametype.scr

Posting Permissions

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