Results 1 to 1 of 1
  1. #1

    Insane limits,, Change Game Mode based on player count

    What I'm trying to make is 2 limits in insane limits that when the server gets 20 or more players in the server it will set the server to "Normal" game mode and when the server has under 20 players its disables the Idle kick and go back to "Custom"

    So far I have got it to make the server go to Normal Mode, But I can't get it to go back to Custom and disable the Idle Kick

    this is what I have so far

    Limit 1
    ------------------------------------------------
    Over 20 Players set to Normal
    ------------------------------------------------

    Evaluation: onRoundOver

    First check: Code

    Code:
    int iCount = 20;
    plugin.ConsoleWrite("^2Set preset to Normal");
    plugin.ServerCommand("vars.preset", "Normal", "false");
    plugin.ConsoleWrite("^2Preset is now ^bNormal^n");
    
    if (server.PlayerCount > iCount);
    
    return false;

    Limit 2
    -----------------------------------------------------------------
    Under 20 Players set to Custom Disable Idle Kick
    -----------------------------------------------------------------

    Evaluation: onRoundOver

    first check: Code


    Code:
    int iCount = 19;
    int idleTimeout = 86400; // Disable Idle Kick
    plugin.ConsoleWrite("^2Setting vars.idleTimeout to " + idleTimeout);
    plugin.ServerCommand("vars.vars.idleTimeout", idleTimeout.ToString());
    plugin.ConsoleWrite("^2Preset is now ^bCustom^n");
    
    if (server.PlayerCount < iCount);
    
    return false;
    Can anyone see where the problem is ?

 

 

Posting Permissions

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