Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Releases & Resources
  3. Server fog command

Server fog command

Scheduled Pinned Locked Moved BO2 Modding Releases & Resources
1 Posts 1 Posters 63 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Vl.Sunnyundefined Offline
    Vl.Sunnyundefined Offline
    Vl.Sunny
    wrote last edited by
    #1

    Couldn't find a way for players to toggle fog without enabling cheats so I made this script.

    Note: This script requires you to install RESXT's main chat_commands script in order to work properly.

    Fog can be toggled on or off by typing your command prefix (default is !) followed by setfog 1 or setfog 0
    e.g. (!setfog 1) in chat

    9b8f3982-f53b-48bf-9401-fb33db221a3c-image.png

    8739b325-ae66-44fa-8e03-0207e74575fe-image.png

    71c7be19-5e17-425a-ad5c-65879e87a4ea-image.png

    Script should be copy and pasted into your plutonium server folder at
    c:\storage\t6\scripts\zm

    #include maps\mp\_utility;
    #include common_scripts\utility;
    #include maps\mp\gametypes_zm\_hud_util;
    #include maps\mp\gametypes_zm\_hud_message;
    #include scripts\chat_commands;
    
    Init()
    {
        CreateCommand(level.chat_commands["ports"], "setfog", "function", ::setFogCommand, 1);
    }
    
    setFogCommand(args)
    {
        player = self;
    
        if (args.size != 1)
        {
            player TellPlayer(array("^3Usage: .setfog <0|1>"), 1);
            return;
        }
    
        fogState = int(args[0]);
    
        if (fogState == 0)
        {
            player setClientDvar("r_fog", 0);
            player TellPlayer(array("^1Fog Disabled"), 1);
        }
        else if (fogState == 1)
        {
            player setClientDvar("r_fog", 1);
            player TellPlayer(array("^2Fog Enabled"), 1);
        }
        else
        {
            player TellPlayer(array("^3Invalid fog state. Use 0 or 1."), 1);
        }
    }
    
    1 Reply Last reply
    0

    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Donate