Configuration file:
The configuration file is located in
<Sourcemod Path>/configs/deathmatch.ini
It uses sourcemod's internal SMC format without the limitations on keyvalues file (eg: you can have sections with same names, even under one same section)
As it may contain a lot of section and subsection, I suggest to use an editor that supports section folding, like notepad++.
The file is case-sensitive!
The configuration is loaded twice for each map:
- At map change, for warmup
- At the end of warmup
Architecture:
The configuration file shall have the following architecture:
Code:
Root Node section ("Deathmatch Config" is the default)
|- Section (Can be named freely)
|- SubSection (Can be named freely)
|- SubSection 2
|- ...
|- Section 2
|- ...
|- "Maps" (Mandatory section)
|- SubSection (Name of a map, or prefix of a map (eg: "aim_")
|- SubSection 2
|- ...
|- "" (Defaut subsection)
The plugin uses the current map name (without extension) and try to find a match into "Maps" subsection names.
If no match is found, an approximate match is tried, comparing only available char in subsection name
Example: With the following subsections under "Maps":
- "awp_scout_map"
- "awp"
- ""
if current map is "awp_scout_map", 1) will be matched
if current map is "awp_stuff", 2) will be matched
if current map is "aim_stuff", 3) will be matched
Note that having a default empty ("") subsection will handle any unmatched map names.
Once a match is found, plugin recursively loads the subsection content.
Subsections:
There are 3 types of subsections:
- NORMAL
- MESSAGE
- TEXT
"Maps" section shall only have Normal subsections.
Other sections may have any type of subsections, their type will be defined by how these subsection have been called.
NORMAL subsections:
Spoiler
These are the more complex.
These subsections may contain the following:
- "SectionOptions" => Used to set some options
- Can contain "AdminMenuName" "<name>"
- If present, given name will appear and be loadable through admin menu
- Can contain "LoadAsAMod" "<Option>"
- Option can only be "" or "KeepClientSettings"
- If LoadAsAMod is present, section loaded on admin command won't unload previous configuration
- If "KeepClientSettings" is set, client weapon choices won't be reset after load on admin command
- "Primary" => Used to list the available primary weapons that will be available in gun menu
- Each line shall be "<weapon name>" "limit"
- limit can be -1 (unlimited) 0 (Not available) or any positive number
- limit is a per-team limit count
- setting limit to 0 will show a weapon in menu that will never be selectable
- A 'h' can be added to set a weapon limit but not show the weapon in menu (eg "weapon_awp" "2h"). This is usefull to limit weapons that can be picked- up on map.
- <weapon name> shall be the entity name (eg: weapon_ak47)
- Do not set a secondary weapon into Primary section
- "Secondary" => Used to list the available secondary weapons, same behavior as "Primary" section
- "WeaponAdd" => Same as Primary and secondary, but weapons are added to existing list instead of starting over a list
- "WeaponRemove" => Same as Primary and secondary, but weapons are removed from existing list
- "Cvars" => Used to set cvars
- Each line shall be "<cvar name>" "<cvar value>"
- Any cvar can be set
- All modified cvars value is saved and restored if plugin is unloaded
- If Cvar is modified for warmup, it is restored at the end of warmup
- Load" => Load all the content of other subsections
- Each line shall be "<section name>" "<subsection name>"
- Everything is case sensitive
- The subsection is fully loaded (recursively) before going to next line
- The loaded subsection shall be of NORMAL type
- Be carefull! Infinite recursion may occur!
- You may even load "Maps" "<whatever>"
- "LoadWarmup" => Same as "Load" but only call when loading for warmup
- "LoadRound" => Same as "Load" but only call when loading at warmup end
- "WarmupOption" => Same as "LoadWarmup" but only one randomly chosen element will be loaded
- "RoundOption" => Same as "LoadRound" but only one randomly chosen element will be loaded
- "LoadMessage" => Same as "Load" but the loaded subsection shall be of MESSAGE type
- "LoadMessageWarmup" => Same as "LoadMessage" but only call when loading for warmup
- "UnloadMessage" => Unloads a message
- Each line shall be "<section name>" "<subsection name>"
- Will not raise error if the target message was not previously loaded
- "DefineWeapon" => Define a new weapon or modify an existing weapon definition
- This allows to modify clip and ammo bullet count
- The available options are the following
- "ClassName" => This is the only mandatory option. This is the weapon name (eg weapon_ak47)
- "DisplayName" => Change weapon name displayed to playes (eg AK-47)
- "Type" => Defines weapon type; can be "Primary", "Secondary" or "Equipment"
- "ItemDefinitionIndex" => Defines the definition index, don't change it if you don't know what you are doing. This is an integer value
- "ReloadTime" => Defines the reload time. This should be set only if not using Dhooks and be a bit higher than actual reload time. This is used to restock ammo after reload
- "SkinTeam" => Defines the tem used to give weapon skin. can be "Both", "T" or "CT"
- "PerBulletReload" => If "0" weapon is normal clip reload, if "1" weapon is reloaded bullet per bullet, like for shotguns
- "ClipSize" => Integer value that define bullet count in clip. This needs Dhook to work
- "OriginalClipSize" => Only usefull for Per Bullet reload weapons. It's the clipSize originaly defined in CS:GO
- "AmmoMax" => Integer value that defines the stock ammo count
- "#LoadType" => Affect Cvar and message locking
- "LockedLoads": Next loaded Cvars can't be overwritten
- "UnlockedLoads": Next loaded Cvars can be overwritten (Default)
- "KeptLoads": Next loaded Cvars and messages won't be restored when admin loads a mod
- "RestoredLoads": Next loaded Cvars and messages will be restored when admin loads a mod (Default)
List of available weapons:
Spoiler
Entity name must be used in sections Priamary or Secondary
Code:
ENTITY NAME WEAPON
Primary weapons
weapon_ak47 => AK-47
weapon_m4a1 => M4A1
weapon_m4a1_silencer => M4A1-S
weapon_sg556 => SG 553
weapon_aug => AUG
weapon_galilar => Galil AR
weapon_famas => FAMAS
weapon_awp => AWP
weapon_ssg08 => Scout
weapon_g3sg1 => G3SG1
weapon_scar20 => SCAR-20
weapon_m249 => M249
weapon_negev => Negev
weapon_nova => Nova
weapon_xm1014 => XM1014
weapon_sawedoff => Sawed-Off
weapon_mag7 => MAG-7
weapon_mac10 => MAC-10
weapon_mp9 => MP9
weapon_mp7 => MP7
weapon_ump45 => UMP-45
weapon_p90 => P90
weapon_bizon => PP-Bizon
Secondary weapons
weapon_glock => Glock
weapon_p250 => P250
weapon_cz75a => CZ75-Auto
weapon_usp_silencer => USP-S
weapon_fiveseven => Five-SeveN
weapon_deagle => Desert Eagle
weapon_revolver => R8 Revolver
weapon_elite => Dual Berettas
weapon_tec9 => Tec-9
weapon_hkp2000 => P2000
MESSAGE subsections:
Spoiler
These are used to load a message to be displayed to users
These subsections may contain the following:
- "DisplayTarget" => Indicate where we should display our message
- Can be "Chat", "Hint" or "Alert"
- Note that "Hint" can display HTML (at least <font size='<size>' color='#<hexa>'> and maybe more)
- Chat can display colors using one of {NORMAL}, {DARK_RED}, {PINK}, {DARK_GREEN}, {YELLOW}, {LIGHT_GREEN}, {LIGHT_RED}, {GRAY}, {ORANGE}, {LIGHT_BLUE}, {DARK_BLUE}, {PURPLE}
- New lines in Hints and Alerts can be inserted with {CARRIAGE_RETURN}
- "DisplayEvent" => When shall the message be displayed
- Can be "Spawn" (on player spawn), "Timer" (on player first spawn then on timer if message shall be repeated)
- "Repeat" => Shall the message be repeated, and how many time?
- Can be "Single" (no repeat), "Infinite" (self explanatory) or a value
- If not "Single" displayed message will cycle through available messages of "Text"
- "Period" (Optional if Repeat = Single) => The repeat period, in seconds
- It shall be a positive integer
- "Delay" (Optional) => Delay for first message display, in seconds
- It shall be a positive integer
- "Priority" (Optional, default 50) => Message priority if two messages have to be displayed at the same time on same display
- It shall be an integer
- Highest has priority
- "Hint" and "Alert" are assumed to be on same display
- "Duration" (Optional, default 0) => Message duration, in seconds
- It shall be a positive integer
- No message can be displayed on target Display during that time
- If target display is Hint or Alert, message is refreshed every seconds to counter display timeout
- "NoReDisplayTime" (Optional, default 0) => Block message display after each display, in seconds
- It shall be a positive integer
- During that time, if a message is requested for display, it will be dropped instead of being delayed
- Usefull to not spam messages with DisplayEvent set to Spawn on Chat target
- "Text" => Same as "Load" but loaded subsection shall be of TEXT type
TEXT subsections: