csgo server convar that sets save/not save weapons after round end
- User
csgo server convar that sets save/not save weapons after round end
- 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:
- Install SourceMod: First, ensure you have SourceMod installed on your CS:GO server.
- 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"); } } } }-
Load the Plugin:
- Save this script with a
.spextension. - Compile it with the SourceMod compiler.
- Place the resulting
.smxfile in your server'saddons/sourcemod/pluginsdirectory.
- Save this script with a
-
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.