Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-2024-05-13· OpenAIAi2 WildChat-4.8M (AI2)

csgo server convar that sets save/not save weapons after round end

  1. User

    csgo server convar that sets save/not save weapons after round end

  2. Assistant

    In Counter-Strike: Global Offensive (CS:GO) server settings, there isn't a specific ConVar that directly sets whether weapons are saved or removed at the end of a round. However, the behavior of saving weapons into the next round is generally determined by the core game mechanics and modes.

    That said, if you want to manipulate weapon retention across rounds, you can use server-side scripts or plugins available through modifications such as SourceMod. These tools allow server operators to change various aspects of the game's behavior, including weapon handling between rounds.

    For example, using SourceMod, you can write a plugin that forces players to drop their weapons at the end of a round:

    1. Install SourceMod: First, ensure you have SourceMod installed on your CS:GO server.
    2. Write a Script:
      • Create a configuration file or script to drop weapons at the end of each round.

    Here is a very basic example of such a script with SourceMod:

    public void OnPluginStart() {
    
        // Hook the event for round end
        HookEvent("round_end", OnRoundEnd);
    }
    
    public Action OnRoundEnd(Handle event, const char[] name, bool dontBroadcast) {
    
        int clientCount = GetMaxClients();
        for (int client = 1; client <= clientCount; client++) {
            if (IsClientInGame(client) && IsPlayerAlive(client)) {
                // Force player to drop their weapons
                StripPlayerWeapons(client);
            }
        }
    }
    
    // Function to strip all weapons from a player
    void StripPlayerWeapons(int client) {
        int weaponCount = GetEntityCount();
        for (int i = 1; i <= weaponCount; i++) {
            if (IsValidEntity(i) && iEntityIndex >= 0) {
                int owner = GetEntPropEnt(i, Prop_Send, "m_hOwnerEntity");
                if (owner == client) {
                    AcceptEntityInput(i, "Kill");
                }
            }
        }
    }
    
    1. Load the Plugin:

      • Save this script with a .sp extension.
      • Compile it with the SourceMod compiler.
      • Place the resulting .smx file in your server's addons/sourcemod/plugins directory.
    2. Server Configuration:

      • Restart your server or change the map to load the plugin.
      • Test to ensure the behavior is as expected.

    If you are not familiar with SourceMod scripting, there are many community plugins available that might meet your needs without writing custom scripts.

    Remember, changing how the game handles weapon retention at the end of rounds can significantly alter gameplay, so use such modifications judiciously and inform your players of these changes.