Commands/Lua
Reference for console commands, Lua hooks and Lua commands in CS2D.
- Console Commands are entered in console, executed with key-binds, cfg-files or with Lua parse
- Lua Hooks execute Lua when events occur - some have a return value which can change the game behavior
- Lua Commands are used to retrieve game data or to perform actions in Lua scripts
CS2D Console Commands
mp_kevlarCategories
Parameters
- percent (0.0-1.0): percentage (0.0=0%, 1.0=100%) of damage which will be absorbed by kevlar
Info
Controls how much damaged is absorbed by kevlar vests.
The internal calculation depends on this setting, the damage value and the armor points you have left.
Possible values range from 0.0 to 1.0 with:
0.0 = no protection (0%)
1.0 = best protection (100%)
the default value is 0.3 (30% protection)
The internal damage calculation works like described below in pseudo code.
// AP = armor points of the hit player
// HP = health points of the hit player
// DMG = damage the player receives
// MAX(X,Y) = returns the bigger of both values
// MIN(X,Y) = returns the smaller of both values (used here to keep value always >= 0)
// Calculate shielded damage
SHIELDED = MIN(DMG, AP)
// Reduce AP by shielded damage
AP = MAX(AP - SHIELDED, 0)
// Reduce HP by percentage of shielded damage (controlled by mp_kevlar)
HP = MAX(HP - (SHIELDED * (1.0 - mp_kevlar)), 0)
// Reduce HP by remaining unshielded damage (full damage)
DMG = DMG - SHIELDED
HP = MAX(HP - DMG, 0)
Lua Hooks
Lua Commands
Categories
Parameters
- percent (0.0-1.0): percentage (0.0=0%, 1.0=100%) of damage which will be absorbed by kevlar
Info
Controls how much damaged is absorbed by kevlar vests.
The internal calculation depends on this setting, the damage value and the armor points you have left.
Possible values range from 0.0 to 1.0 with:
0.0 = no protection (0%)
1.0 = best protection (100%)
the default value is 0.3 (30% protection)
The internal damage calculation works like described below in pseudo code.
// AP = armor points of the hit player
// HP = health points of the hit player
// DMG = damage the player receives
// MAX(X,Y) = returns the bigger of both values
// MIN(X,Y) = returns the smaller of both values (used here to keep value always >= 0)
// Calculate shielded damage
SHIELDED = MIN(DMG, AP)
// Reduce AP by shielded damage
AP = MAX(AP - SHIELDED, 0)
// Reduce HP by percentage of shielded damage (controlled by mp_kevlar)
HP = MAX(HP - (SHIELDED * (1.0 - mp_kevlar)), 0)
// Reduce HP by remaining unshielded damage (full damage)
DMG = DMG - SHIELDED
HP = MAX(HP - DMG, 0)
The internal calculation depends on this setting, the damage value and the armor points you have left.
Possible values range from 0.0 to 1.0 with:
0.0 = no protection (0%)
1.0 = best protection (100%)
the default value is 0.3 (30% protection)
The internal damage calculation works like described below in pseudo code.
// AP = armor points of the hit player
// HP = health points of the hit player
// DMG = damage the player receives
// MAX(X,Y) = returns the bigger of both values
// MIN(X,Y) = returns the smaller of both values (used here to keep value always >= 0)
// Calculate shielded damage
SHIELDED = MIN(DMG, AP)
// Reduce AP by shielded damage
AP = MAX(AP - SHIELDED, 0)
// Reduce HP by percentage of shielded damage (controlled by mp_kevlar)
HP = MAX(HP - (SHIELDED * (1.0 - mp_kevlar)), 0)
// Reduce HP by remaining unshielded damage (full damage)
DMG = DMG - SHIELDED
HP = MAX(HP - DMG, 0)