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
Category: all (371)
- ah
- ak47
- alias
- aliases
- attack
- attack2
- aug
- autobuy
- autoscreen
- autoswitch
- awp
- back
- banip
- banname
- bans
- bansteam
- banusgn
- bind
- bot
- bot_add
- bot_add_ct
- bot_add_t
- bot_autofill
- bot_count
- bot_freeze
- bot_jointeam
- bot_keepfreeslots
- bot_kill
- bot_prefix
- bot_remove
- bot_remove_all
- bot_remove_ct
- bot_remove_t
- bot_skill
- bot_weapons
- bullets
- buy
- buyammo1
- buyammo2
- buyequip
- changelevel
- changemap
- chooseteam
- clear
- clientport
- close
- cmsg
- connections
- console
- copyaddress
- customkill
- damageobject
- damagetile
- deagle
- deathnoticeimg
- deathslap
- debug
- debugai
- debuglog
- debuglua
- debugstats
- defuser
- disconnect
- dmgindicator
- download
- drawradar
- drop
- echo
- effect
- elite
- elites
- endround
- equip
- exec
- exit
- explosion
- famas
- flare
- flash
- flashlight
- flashplayer
- flashposition
- fn57
- forward
- fowalpha
- fowdetails
- fps
- freeprojectile
- g3sg1
- galil
- glock
- gore
- grenademode
- hegren
- hudtxt
- hudtxt2
- hudtxtalphafade
- hudtxtclear
- hudtxtcolorfade
- hudtxtmove
- hud_fastswitch
- hud_takesshots
- include
- invnext
- invprev
- items
- itemshadows
- kick
- kill
- killobject
- killplayer
- lastinv
- left
- lefthand
- listbans
- listplayers
- localport
- logaddress_add
- logaddress_remove
- logaddress_removeall
- logbatch
- logmaxflushrate
- logsplit
- logstamp
- lua
- luareset
- m249
- m3
- m4a1
- mac10
- makect
- makespec
- maket
- map
- mapinfo
- maps
- mapshadows
- mapsounds
- markplayer
- memory
- menuselect
- menu_lanscanport
- mp5
- mp_antispeeder
- mp_autogamemode
- mp_autoteambalance
- mp_building_health
- mp_building_limit
- mp_building_price
- mp_buymenu
- mp_buytime
- mp_c4timer
- mp_connectionlimit
- mp_curtailedexplosions
- mp_damagefactor
- mp_deathdrop
- mp_dispenser_health
- mp_dispenser_money
- mp_dmspawnmoney
- mp_dropgrenades
- mp_flashlight
- mp_floodprot
- mp_floodprotignoretime
- mp_freezetime
- mp_grenaderebuy
- mp_hostagepenalty
- mp_hovertext
- mp_hud
- mp_hudscale
- mp_idleaction
- mp_idlekick
- mp_idletime
- mp_infammo
- mp_kevlar
- mp_kickpercent
- mp_killbuildingmoney
- mp_killbuildings
- mp_killinfo
- mp_killteambuildings
- mp_lagcompensation
- mp_lagcompensationdivisor
- mp_localrconoutput
- mp_luamap
- mp_luaserver
- mp_mapgoalscore
- mp_mapvoteratio
- mp_maxclientsip
- mp_maxrconfails
- mp_natholepunching
- mp_pinglimit
- mp_postspawn
- mp_radar
- mp_randomspawn
- mp_recoil
- mp_reservations
- mp_respawndelay
- mp_roundlimit
- mp_roundtime
- mp_shotweakening
- mp_smokeblock
- mp_startmoney
- mp_supply_items
- mp_teamkillpenalty
- mp_teleportreload
- mp_tempbantime
- mp_timelimit
- mp_tkpunish
- mp_trace
- mp_turretdamage
- mp_unbuildable
- mp_unbuyable
- mp_vulnerablehostages
- mp_weaponfadeout
- mp_winlimit
- mp_wpndmg
- mp_wpndmg_z1
- mp_wpndmg_z2
- mp_zombiedmg
- mp_zombiekillequip
- mp_zombiekillscore
- mp_zombierecover
- mp_zombiespeedmod
- msg
- name
- netinfo
- nick
- nightvision
- nvgs
- p228
- p90
- particles
- playershadows
- quit
- radio1
- radio2
- radio3
- rcon
- rcon_password
- rcon_pw
- rebuy
- recoil
- relativemovement
- reload
- removeitem
- render3d
- renderdecals
- renderdecoration
- reroute
- resources
- restart
- restartround
- right
- say
- sayteam
- scout
- screenshot
- server
- serveraction1
- serveraction2
- serveraction3
- serverinfo
- setammo
- setarmor
- setassists
- setdeaths
- sethealth
- setmaxhealth
- setmoney
- setmvp
- setname
- setpos
- setscore
- setteamscores
- settile
- setweapon
- SG550
- sg552
- sgren
- shadows
- shadowshade_obstacle
- shadowshade_wall
- shadowz_obstacles
- shadowz_wall
- shadow_angle
- shadow_frameskipping
- shake
- shield
- showscores
- slap
- slot0
- slot1
- slot10
- slot2
- slot3
- slot4
- slot5
- slot6
- slot7
- slot8
- slot9
- snapshot
- sounddriver
- soundmode
- spawnitem
- spawnnpc
- spawnobject
- spawnplayer
- spawnprojectile
- specmode
- specplayer
- speed
- speedmod
- spray
- spraycolor
- spraylogo
- strip
- sv_checkusgnlogin
- sv_daylighttime
- sv_forcelight
- sv_fow
- sv_friendlyfire
- sv_gamemode
- sv_gm
- sv_hostport
- sv_lan
- sv_map
- sv_maptransfer
- sv_maxplayers
- sv_msg
- sv_msg2
- sv_name
- sv_offscreendamage
- sv_password
- sv_rcon
- sv_rconusers
- sv_restart
- sv_restartround
- sv_sound
- sv_sound2
- sv_soundpos
- sv_specmode
- sv_spraytransfer
- sv_stopsound
- sv_usgnonly
- team
- tileanimations
- tmp
- transfer_speed
- trigger
- triggerposition
- ump45
- unban
- unbanall
- unbindall
- use
- usgn_addserver
- usgn_info
- usgn_pw
- usgn_user
- usp
- vest
- vesthelm
- visibleshots
- volume
- vote
- votemap
- votemenu
- weapon
- wiggle
- win
- xm1014
customkillCategories
Parameters
- killer (0-32): killer player id (or 0 for no killer)
- weapon (text): a name for the weapon the killer used (as text!) + optionally a path to an image
- victim (1-32): victim player id
Info
Simulate a kill with a custom weapon (as server only). This will also generate an appropriate death notice in the top right corner of the screen and give the killer an additional kill in the scoreboard.
Use killer 0 for suicides or "environment kills".
You can also specify a custom kill image in addition to the weapon name. Both are in the weapon parameter and they have to be separated with a comma. This image will only be displayed if the setting deathnoticeimg is set to 1! Otherwise the game will just display the text.
So the format for weapon can either be
"weapon name"
or
"weapon name,image path"
Note that you have to use quotes as soon as there are any spaces in the weapon name or in the weapon path! You don't have to use quotes around this parameter if there are no spaces.
Note: Nothing will happen if the victim is already dead!
Note: The path for custom kill images is relative to the CS2D main folder
Note: Custom kill images should be grayscale because they are rendered with blending. White parts will become bright and dark parts will become invisible.
Attention: Custom kill images should have a height of about 10 pixels. Higher images might overlap other death notices!
Attention: CS2D will NOT transfer the kill image to clients automatically! You have to put it into "sys/servertransfer.lst" like all custom images you are using in scripts. Otherwise clients won't see them! Also clients can still refuse to load them (depends on their settings)
Sample 1: Player 1 kills player 2 with a custom weapon (name only)
customkill 1 "Random Weapon Name" 2
Sample 2: Player 1 kills player 2 with a custom weapon and a custom kill image
customkill 1 "Random Weapon Name,gfx/gui_server.bmp" 2
Sample 3: Player 3 is killed by the environment (because killer is 0)
customkill 0 "Trap" 3
Lua Hooks
Lua Commands
Categories
Parameters
- killer (0-32): killer player id (or 0 for no killer)
- weapon (text): a name for the weapon the killer used (as text!) + optionally a path to an image
- victim (1-32): victim player id
Info
Simulate a kill with a custom weapon (as server only). This will also generate an appropriate death notice in the top right corner of the screen and give the killer an additional kill in the scoreboard.
Use killer 0 for suicides or "environment kills".
You can also specify a custom kill image in addition to the weapon name. Both are in the weapon parameter and they have to be separated with a comma. This image will only be displayed if the setting deathnoticeimg is set to 1! Otherwise the game will just display the text.
So the format for weapon can either be
"weapon name"
or
"weapon name,image path"
Note that you have to use quotes as soon as there are any spaces in the weapon name or in the weapon path! You don't have to use quotes around this parameter if there are no spaces.
Sample 1: Player 1 kills player 2 with a custom weapon (name only)
Sample 2: Player 1 kills player 2 with a custom weapon and a custom kill image
Sample 3: Player 3 is killed by the environment (because killer is 0)
Use killer 0 for suicides or "environment kills".
You can also specify a custom kill image in addition to the weapon name. Both are in the weapon parameter and they have to be separated with a comma. This image will only be displayed if the setting deathnoticeimg is set to 1! Otherwise the game will just display the text.
So the format for weapon can either be
"weapon name"
or
"weapon name,image path"
Note that you have to use quotes as soon as there are any spaces in the weapon name or in the weapon path! You don't have to use quotes around this parameter if there are no spaces.
Note: Nothing will happen if the victim is already dead!
Note: The path for custom kill images is relative to the CS2D main folder
Note: Custom kill images should be grayscale because they are rendered with blending. White parts will become bright and dark parts will become invisible.
Attention: Custom kill images should have a height of about 10 pixels. Higher images might overlap other death notices!
Attention: CS2D will NOT transfer the kill image to clients automatically! You have to put it into "sys/servertransfer.lst" like all custom images you are using in scripts. Otherwise clients won't see them! Also clients can still refuse to load them (depends on their settings)
Sample 1: Player 1 kills player 2 with a custom weapon (name only)
customkill 1 "Random Weapon Name" 2
Sample 2: Player 1 kills player 2 with a custom weapon and a custom kill image
customkill 1 "Random Weapon Name,gfx/gui_server.bmp" 2
Sample 3: Player 3 is killed by the environment (because killer is 0)
customkill 0 "Trap" 3