This is a server-side plugin that adds random fun effects on a time interval in Counter Strike 2. The idea is inspired by the GTAV Chaos Mod by pongo1231.
The plugin is made using C# via CounterStrikeSharp.
- Make sure to have MetaMod:Source and CSSharp With Runtime installed as described here.
- Download the latest release of ChaosPlugin.
- Extract the contents of the zip file into [CS2 Server Dir]\game\csgo\addons\counterstrikesharp\plugins\
- Start the server and type
.chaosin chat orchaosin the console to verify that the plugin has loaded correctly.
I accept contributions via new effects. These effects must be created in a new file located in /Effects/Effects/ if it is an effect that should be loaded, or under /Effects/Bases/ if it is an abstract class that should not be spawned in as an effect.
ChaosPlugin - The plugin class. This is the class that deals with initializing the whole plugin, getting plugin information etc. It also manages console commands and CVars. It also contains code "borrowed" from poggu to fix flashing center text display.
- This contains a static property called
Plugin, which is the instance of the plugin. Will benullif the plugin is not loaded. - Another useful property is
Manager(not static this time), which is simply the instance of theEffectManagerwhich is being used.
ChaosManager - This is a class that manages all the effects, adds them, removes them and displays relevant information about them. It also automatically registers all relevant effect types to be used. Here are some useful fields and functions:
Random Rand- An instance of theRandomclassList<ChaosEffect> CurrentEffects- The list of the currently active effectspublic static string RepeatString(string Str, int Amount)- Repeats a stringStrAmounttimespublic void EmitSoundToAll(string Sound)- Plays a sound from a string to all players.MakeProgressBar(float Percent, int BarLength)- Uses characters ▓ and ░ to make a string progress bar of lengthBarLengthcharacters.public void RemoveAllEffects()- Removes all active effects.public ChaosEffect? CreateEffect(string Effect)- Creates an effect from its UId (Class name)public static string GetColoredText(string Message)- Converts a string containing{[color]}(where [color] is replaced with the name of a color) with a string that can be used to create colored text in CS2. The supported colors are:- default
- white
- darkred
- purple
- green
- lightgreen
- slimegreen
- red
- grey
- yellow
- invisible
- lightblue
- blue
- lightpurple
- pink
- fadedred
- gold
ChaosEffect - The base class for all effects. For an effect to be valid, it should have certain methods, fields and properties overridden, which are stated below:
public virtual ChaosEffectDuration Duration- This is a way to automatically handle duration. The way this is used is defined inGetEffectDuration. By default, this returnsChaosEffectDuration.Instantaneous, meaning that the effect will have no duration.- Example:
public override ChaosEffectDuration Duration => ChaosEffectDuration.Long;
- Example:
public virtual string GetEffectName- The display name of the effect.- Example:
public override string GetEffectName => "Colorful Smokes";
- Example:
public virtual string GetEffectDescription- The description of the effect. This will be displayed in chat when the effect is spawned. It should therefore be quite brief.- Example:
public override string GetEffectDescription => "Makes smokes colorful!";
- Example:
- OPTIONAL
public virtual void StartEffect()- The function gets called when the effect is spawned. - OPTIONAL
public virtual void EndEffect()- The function gets called when the effect ends or gets interrupted. (Only called when the duration is >0) - OPTIONAL
public virtual void TickEffect(float Dt)- The function gets called on tick while the effect is active. (Only called when the duration is >0) - OPTIONAL
public virtual float GetEffectDuration()- Should return the duration of the effect. returning 0 means no duration, which has the above consequences. - OPTIONAL
public virtual HashSet<string> IncompatibleEffects- Should return a list of incompatible effect class names which should be removed if active. For example an effect which increases gravity would be incompatible with one that lowers it. - OPTIONAL
public virtual string? Category- Getter for a category. Null for no category. Two effects of the same category cannot coexist. It is an easier wa to define incompatibilities.
ChaosUtilities A utility class containing some useful functions.
IMPORTANT NOTE: If an effect is not to be loaded in by the effect manager as a usable effect, then it should be marked as abstract
NOTE: If an effect is an event listener, remember to remove it as a listener when the effect ends.
- CVar config
ColorfulSmokesNothingExplode in midairShuffle locationsCall of Duty (no recoil, no spread)Moon gravityNo GravityExtreme GravityGo Eco (remove all money)Rich Kid (Max money)London (Everyone is left with knife only)Auto bhopRussian Roulette (Kill random player)Explosive combat (Every hit spawns an explosion)OHKO (1hp, gives back hp on end)InvisibilityValve DM experience (Everyone is given an awp)Spawn chickenRandomize healthNegev is meta (Give everyone a negev)Decoy Grenade teleportersRainbow playersEz For Ence (Plays the song)Spawn fake explosionInfinite ammoWallHackRandomize loadoutEveryone is invincible (Except bomb planter and bomb diffuser)0.2x game speed2x game speed1.1x game speed- Back to spawn (Everyone gets teleported to spawn)
- Infinite nades
- Heavy recoil (not only more recoil, but shooting pushes you backwards)
- Flashbang (Everyone gets flashed)
- CS2 Moment (Extreme spread)
- Pacifist (Killing someone will blow you up - Except for killing bomb planter or diffuser)
- Flip everyone (Everyone turns 180 degrees)
- Minimal damage
- Schizo (Plays misleading sounds)
- LAG (rolls back position frequently)
- Airstrike (Spawn HEs falling from the sky)
- Bomb can be planted anywhere
- Buy anywhere
- Teleport random CT to C4
- spawn smoke
- spawn decoy grenade
- Everyone is tiny
- Everyone is huge
- Explode all chicken
- Spawn huge chicken