Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2024
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /** @noSelfInFile */
  2. /**
  3.  * Possible Player ID's
  4.  */
  5. declare type PlayerID =
  6.   | 0
  7.   | 1
  8.   | 2
  9.   | 3
  10.   | 4
  11.   | 5
  12.   | 6
  13.   | 7
  14.   | 8
  15.   | 9
  16.   | 10
  17.   | 11
  18.   | 12
  19.   | 13
  20.   | 14
  21.   | 15
  22.   | 16
  23.   | 17
  24.   | 18
  25.   | 19
  26.   | 20
  27.   | 21
  28.   | 22
  29.   | 23
  30.   | 24
  31.   | 25
  32.   | 26
  33.   | 27
  34.   | 28
  35.   | 29
  36.   | 30
  37.   | 31
  38.   | 32;
  39.  
  40. /**
  41.  * Console Settings that can be accessed by the 'game' function
  42.  */
  43. declare type ConsoleCommandsSettings =
  44.   | "ah"
  45.   | "autoscreen"
  46.   | "autoswitch"
  47.   | "bot_count"
  48.   | "bot_jointeam"
  49.   | "bot_prefix"
  50.   | "bot_skill"
  51.   | "bot_weapons"
  52.   | "bullets"
  53.   | "connection"
  54.   | "debug"
  55.   | "debugai"
  56.   | "debuglog"
  57.   | "debuglua"
  58.   | "dmgindicator"
  59.   | "drawradar"
  60.   | "fowalpha"
  61.   | "fowdetails"
  62.   | "gore"
  63.   | "grenademode"
  64.   | "hud_fastswitch"
  65.   | "itemshadows"
  66.   | "localport"
  67.   | "mapshadows"
  68.   | "mapsounds"
  69.   | "markplayer"
  70.   | "menu_lanscanport"
  71.   | "mp_antispeeder"
  72.   | "mp_autogamemode"
  73.   | "mp_autoteambalance"
  74.   | "mp_buytime"
  75.   | "mp_c4timer"
  76.   | "mp_connectionlimit"
  77.   | "mp_curtailedexplosions"
  78.   | "mp_damagefactor"
  79.   | "mp_deathdrop"
  80.   | "mp_dispenser_health"
  81.   | "mp_dispenser_money"
  82.   | "mp_dmspawnmoney"
  83.   | "mp_dropgrenades"
  84.   | "mp_flashlight"
  85.   | "mp_floodprot"
  86.   | "mp_floodprotignoretime"
  87.   | "mp_freezetime"
  88.   | "mp_grenaderebuy"
  89.   | "mp_hostagepenalty"
  90.   | "mp_hovertext"
  91.   | "mp_hud"
  92.   | "mp_hudscale"
  93.   | "mp_idleaction"
  94.   | "mp_idlekick"
  95.   | "mp_idletime"
  96.   | "mp_infammo"
  97.   | "mp_kevlar"
  98.   | "mp_kickpercent"
  99.   | "mp_killbuildingmoney"
  100.   | "mp_killbuildings"
  101.   | "mp_killinfo"
  102.   | "mp_killteambuildings"
  103.   | "mp_lagcompensation"
  104.   | "mp_lagcompensationdivisor"
  105.   | "mp_localrconoutput"
  106.   | "mp_luamap"
  107.   | "mp_luaserver"
  108.   | "mp_mapgoalscore"
  109.   | "mp_mapvoteratio"
  110.   | "mp_maxclientsip"
  111.   | "mp_maxrconfails"
  112.   | "mp_natholepunching"
  113.   | "mp_pinglimit"
  114.   | "mp_postspawn"
  115.   | "mp_radar"
  116.   | "mp_randomspawn"
  117.   | "mp_recoil"
  118.   | "mp_respawndelay"
  119.   | "mp_roundlimit"
  120.   | "mp_roundtime"
  121.   | "mp_shotweakening"
  122.   | "mp_smokeblock"
  123.   | "mp_startmoney"
  124.   | "mp_supply_items"
  125.   | "mp_teamkillpenalty"
  126.   | "mp_teleportreload"
  127.   | "mp_tempbantime"
  128.   | "mp_timelimit"
  129.   | "mp_tkpunish"
  130.   | "mp_trace"
  131.   | "mp_turretdamage"
  132.   | "mp_unbuyable"
  133.   | "mp_vulnerablehostages"
  134.   | "mp_weaponfadeout"
  135.   | "mp_winlimit"
  136.   | "mp_zombiedmg"
  137.   | "mp_zombiekillequip"
  138.   | "mp_zombiekillscore"
  139.   | "mp_zombierecover"
  140.   | "mp_zombiespeedmod"
  141.   | "name"
  142.   | "particles"
  143.   | "playershadows"
  144.   | "recoil"
  145.   | "relativemovement"
  146.   | "renderdecals"
  147.   | "renderdecoration"
  148.   | "shadows"
  149.   | "shadowshade_obstacle"
  150.   | "shadowshade_wall"
  151.   | "soundmode"
  152.   | "spraycolor"
  153.   | "spraylogo"
  154.   | "sv_checkusgnlogin"
  155.   | "sv_daylighttime"
  156.   | "sv_fow"
  157.   | "sv_friendlyfire"
  158.   | "sv_gamemode"
  159.   | "sv_hostport"
  160.   | "sv_lan"
  161.   | "sv_map"
  162.   | "sv_maptransfer"
  163.   | "sv_maxplayers"
  164.   | "sv_name"
  165.   | "sv_offscreendamage"
  166.   | "sv_password"
  167.   | "sv_specmode"
  168.   | "sv_spraytransfer"
  169.   | "sv_usgnonly"
  170.   | "tileanimations"
  171.   | "transfer_speed"
  172.   | "visibleshots"
  173.   | "volume"
  174.   | "wiggle";
  175.  
  176. /**
  177.  * Numeric Keys [0-9] that can be used in the 'addbind' function
  178.  */
  179. declare type BindKeyNumeric =
  180.   | "0"
  181.   | "1"
  182.   | "2"
  183.   | "3"
  184.   | "4"
  185.   | "5"
  186.   | "6"
  187.   | "7"
  188.   | "8"
  189.   | "9";
  190. /**
  191.  * Alphabetic Keys [A-Z] that can be used in the 'addbind' function
  192.  */
  193. declare type BindKeyAlphabetic =
  194.   | "A"
  195.   | "B"
  196.   | "C"
  197.   | "D"
  198.   | "E"
  199.   | "F"
  200.   | "G"
  201.   | "H"
  202.   | "I"
  203.   | "J"
  204.   | "K"
  205.   | "L"
  206.   | "M"
  207.   | "N"
  208.   | "O"
  209.   | "P"
  210.   | "Q"
  211.   | "R"
  212.   | "S"
  213.   | "T"
  214.   | "U"
  215.   | "V"
  216.   | "W"
  217.   | "X"
  218.   | "Y"
  219.   | "Z";
  220. /**
  221.  * Function Keys [F1-F12] that can be used in the 'addbind' function
  222.  */
  223. declare type BindKeyFunction =
  224.   | "F1"
  225.   | "F2"
  226.   | "F3"
  227.   | "F4"
  228.   | "F5"
  229.   | "F6"
  230.   | "F7"
  231.   | "F8"
  232.   | "F9"
  233.   | "F10"
  234.   | "F11"
  235.   | "F12";
  236. /**
  237.  * Mouse Buttons
  238.  *
  239.  * mouse1 - Left Click
  240.  *
  241.  * mouse2 - Right Click
  242.  * mouse3 - Middle Click
  243.  *
  244.  * mwheelup - Mouse Wheel Up
  245.  *
  246.  * mywheeldown - Mouse Wheel Down
  247.  */
  248. declare type BindKeyMouse =
  249.   | "mouse1"
  250.   | "mouse2"
  251.   | "mouse3"
  252.   | "mwheelup"
  253.   | "mwheeldown";
  254. /**
  255.  * System [shift, control, alt, sys] keys that can be used in the 'addbind' function.
  256.  */
  257. declare type BindKeySpecial =
  258.   | "leftshift"
  259.   | "rightshift"
  260.   | "leftctrl"
  261.   | "rightctrl"
  262.   | "leftalt"
  263.   | "rightalt"
  264.   | "leftsys"
  265.   | "rightsys";
  266. /**
  267.  * Arrow keys [left, right, up, down] that can be used the in the 'addbind' function.
  268.  */
  269. declare type BindKeyArrow =
  270.   | "leftarrow"
  271.   | "rightarrow"
  272.   | "uparrow"
  273.   | "downarrow";
  274. /**
  275.  * Other keys like backspace, tab, clear, enter, space, keypad keys, misc keys that can be used in the 'addbind' function
  276.  */
  277. declare type BindKeyOther =
  278.   | "backspace"
  279.   | "tab"
  280.   | "clear"
  281.   | "enter"
  282.   | "escape"
  283.   | "space"
  284.   | "pgup"
  285.   | "pgdn"
  286.   | "end"
  287.   | "home"
  288.   | "select"
  289.   | "print"
  290.   | "execute"
  291.   | "screen"
  292.   | "ins"
  293.   | "del"
  294.   | "kp_leftarrow"
  295.   | "kp_home"
  296.   | "kp_ins"
  297.   | "kp_0"
  298.   | "kp_1"
  299.   | "kp_2"
  300.   | "kp_3"
  301.   | "kp_4"
  302.   | "kp_5"
  303.   | "kp_6"
  304.   | "kp_7"
  305.   | "kp_8"
  306.   | "kp_9"
  307.   | "kp_divide"
  308.   | "kp_multiply"
  309.   | "kp_del";
  310. /**
  311.  * All keys that can be used in the 'addbind' function
  312.  */
  313. declare type BindKeyValue =
  314.   | BindKeyNumeric
  315.   | BindKeyAlphabetic
  316.   | BindKeyFunction
  317.   | BindKeyMouse
  318.   | BindKeySpecial
  319.   | BindKeyArrow
  320.   | BindKeyOther;
  321. /**
  322.  * Category that contains the basic hooks
  323.  */
  324. declare type HookValueBasic =
  325.   | "break"
  326.   | "endround"
  327.   | "httpdata"
  328.   | "log"
  329.   | "mapchange"
  330.   | "parse"
  331.   | "projectile"
  332.   | "projectile_impact"
  333.   | "rcon"
  334.   | "shutdown"
  335.   | "startround"
  336.   | "startround_prespawn"
  337.   | "trigger"
  338.   | "triggerentity";
  339. /**
  340.  * Category that contains the time hooks
  341.  */
  342. declare type HookValueTime = "always" | "minute" | "ms100" | "second";
  343. /**
  344.  * Category that contains anything involving the player
  345.  */
  346. declare type HookValuePlayer =
  347.   | "assist"
  348.   | "attack"
  349.   | "attack2"
  350.   | "bombdefuse"
  351.   | "bombexplode"
  352.   | "bombplant"
  353.   | "build"
  354.   | "buildattempt"
  355.   | "buy"
  356.   | "clientdata"
  357.   | "clientsetting"
  358.   | "collect"
  359.   | "connect"
  360.   | "die"
  361.   | "disconnect"
  362.   | "dominate"
  363.   | "drop"
  364.   | "flagcapture"
  365.   | "flagtake"
  366.   | "flashlight"
  367.   | "hit"
  368.   | "hostagedamage"
  369.   | "hostagekill"
  370.   | "hostagerescue"
  371.   | "hostageuse"
  372.   | "itemfadeout"
  373.   | "join"
  374.   | "key"
  375.   | "kill"
  376.   | "leave"
  377.   | "menu"
  378.   | "move"
  379.   | "movetile"
  380.   | "name"
  381.   | "radio"
  382.   | "reload"
  383.   | "say"
  384.   | "sayteam"
  385.   | "select"
  386.   | "serveraction"
  387.   | "shieldhit"
  388.   | "spawn"
  389.   | "specswitch"
  390.   | "spray"
  391.   | "suicide"
  392.   | "team"
  393.   | "use"
  394.   | "usebutton"
  395.   | "vipescape"
  396.   | "vote"
  397.   | "walkover";
  398. /**
  399.  * Category that contains anything involving objects
  400.  */
  401. declare type HookValueObject =
  402.   | "hitzone"
  403.   | "objectdamage"
  404.   | "objectkill"
  405.   | "objectupgrade"
  406.   | "turretscan";
  407. /**
  408.  * All Possible Hook Values
  409.  */
  410. declare type HookValue =
  411.   | HookValueBasic
  412.   | HookValueTime
  413.   | HookValuePlayer
  414.   | HookValueObject;
  415.  
  416. /**
  417.  * Values that can be passed onto as a parameter to the 'entity' function.
  418.  */
  419. declare type EntityValue =
  420.   | "exists"
  421.   | "typename"
  422.   | "type"
  423.   | "name"
  424.   | "trigger"
  425.   | "state"
  426.   | "int0"
  427.   | "int1"
  428.   | "int2"
  429.   | "int3"
  430.   | "int4"
  431.   | "int5"
  432.   | "int6"
  433.   | "int7"
  434.   | "int8"
  435.   | "int9"
  436.   | "str0"
  437.   | "str1"
  438.   | "str2"
  439.   | "str3"
  440.   | "str4"
  441.   | "str5"
  442.   | "str6"
  443.   | "str7"
  444.   | "str8"
  445.   | "str9"
  446.   | "aistate";
  447.  
  448. /**
  449.  * Values that can be passed onto as a parameter to the 'game' function.
  450.  */
  451. declare type GameValue =
  452.   | "version"
  453.   | "dedicated"
  454.   | "phase"
  455.   | "round"
  456.   | "timeleft"
  457.   | "maptimeleft"
  458.   | "score_t"
  459.   | "score_ct"
  460.   | "winrow_t"
  461.   | "winrow_ct"
  462.   | "nextmap"
  463.   | "ticks"
  464.   | "port"
  465.   | "bombplanted"
  466.   | "sysfolder"
  467.   | ConsoleCommandsSettings;
  468.  
  469. /**
  470.  * Values that can be passed onto as a parameter to the 'hostage' function.
  471.  */
  472. declare type HostageValueBoolean = "exists" | "used";
  473. declare type HostageValueNumbers =
  474.   | "health"
  475.   | "follow"
  476.   | "look"
  477.   | "x"
  478.   | "y"
  479.   | "rot"
  480.   | "tilex"
  481.   | "tiley";
  482. declare type HostageValueTable = "table";
  483. /**
  484.  * Values that can be passed onto as a parameter to the 'imageparam' function.
  485.  */
  486. declare type ImageparamValueStrings = "path";
  487. declare type ImageparamValueNumbers =
  488.   | "x"
  489.   | "y"
  490.   | "rot"
  491.   | "alpha"
  492.   | "frame"
  493.   | "width"
  494.   | "height"
  495.   | "framecount";
  496. /**
  497.  * Values that can be passed onto as a parameter to the 'object' function.
  498.  */
  499. declare type ObjectValueBoolean = "exists" | "entity";
  500. declare type ObjectValueNumbers =
  501.   | "type"
  502.   | "health"
  503.   | "mode"
  504.   | "team"
  505.   | "player"
  506.   | "x"
  507.   | "y"
  508.   | "rot"
  509.   | "alpha"
  510.   | "tilex"
  511.   | "tiley"
  512.   | "countdown"
  513.   | "rootrot"
  514.   | "idle"
  515.   | "rotvar"
  516.   | "target"
  517.   | "upgrade"
  518.   | "entityx"
  519.   | "entityy";
  520. declare type ObjectValueTable = "table";
  521. declare type ObjectValues =
  522.   | ObjectValueBoolean
  523.   | ObjectValueNumbers
  524.   | ObjectValueTable;
  525. /**
  526.  * Values that can be passed onto as a parameter to the 'item' function.
  527.  */
  528. declare type WeaponItemValueBoolean = "exists" | "dropped";
  529. declare type WeaponItemValueNumbers =
  530.   | "type"
  531.   | "player"
  532.   | "ammo"
  533.   | "ammoin"
  534.   | "mode"
  535.   | "x"
  536.   | "y"
  537.   | "droptimer";
  538. declare type WeaponItemValueStrings = "name";
  539. declare type WeaponItemValueTable = "table";
  540. declare type WeaponItemValues =
  541.   | WeaponItemValueBoolean
  542.   | WeaponItemValueNumbers
  543.   | WeaponItemValueStrings
  544.   | WeaponItemValueTable;
  545. /**
  546.  * Values that can be passed onto as a parameter to the 'objecttype' function.
  547.  */
  548. declare type ObjectTypeValueStrings = "name" | "internalname";
  549. declare type ObjectTypeValueNumbers =
  550.   | "type"
  551.   | "price"
  552.   | "health"
  553.   | "killmoney"
  554.   | "limit"
  555.   | "upgradepoints"
  556.   | "upgradeprice"
  557.   | "upgradeto";
  558. /**
  559.  * Values that can be passed onto as a parameter to the 'itemtype' function.
  560.  */
  561. declare type WeaponItemTypeValueStrings = "name";
  562. declare type WeaponItemTypeValueNumbers =
  563.   | "dmg"
  564.   | "dmg_z1"
  565.   | "dmg_z2"
  566.   | "rate"
  567.   | "reload"
  568.   | "ammo"
  569.   | "ammoin"
  570.   | "price"
  571.   | "range"
  572.   | "dispersion"
  573.   | "slot"
  574.   | "recoil";
  575. /**
  576.  * Values that can be passed onto as a parameter to the 'map' function.
  577.  */
  578. declare type MapValueStrings = "name" | "tileset" | "back_img";
  579. declare type MapValueNumbers =
  580.   | "xsize"
  581.   | "ysize"
  582.   | "tilesize"
  583.   | "tilecount"
  584.   | "back_scrollx"
  585.   | "back_scrolly"
  586.   | "back_scrolltile"
  587.   | "back_r"
  588.   | "back_g"
  589.   | "back_b"
  590.   | "storm_x"
  591.   | "storm_y"
  592.   | "mission_vips"
  593.   | "mission_hostages"
  594.   | "mission_bombspots"
  595.   | "mission_ctfflags"
  596.   | "mission_dompoints"
  597.   | "nobuying"
  598.   | "noweapons"
  599.   | "teleporters"
  600.   | "botnodes";
  601. /**
  602.  * Values that can be passed onto as a parameter to the 'player' function.
  603.  */
  604. declare type PlayerValueBoolean =
  605.   | "exists"
  606.   | "bot"
  607.   | "rcon"
  608.   | "defusekit"
  609.   | "gasmask"
  610.   | "bomb"
  611.   | "flag"
  612.   | "reloading"
  613.   | "nightvision";
  614. declare type PlayerValueStrings =
  615.   | "name"
  616.   | "ip"
  617.   | "usgnname"
  618.   | "steamid"
  619.   | "steamname"
  620.   | "language"
  621.   | "language_iso"
  622.   | "sprayname";
  623. declare type PlayerValueNumbers =
  624.   | "port"
  625.   | "usgn"
  626.   | "team"
  627.   | "favteam"
  628.   | "look"
  629.   | "spraycolor"
  630.   | "mousex"
  631.   | "mousey"
  632.   | "mousemapx"
  633.   | "mousemapy"
  634.   | "mousedist"
  635.   | "screenw"
  636.   | "screenh"
  637.   | "widescreen"
  638.   | "windowed"
  639.   | "micsupport"
  640.   | "x"
  641.   | "y"
  642.   | "tilex"
  643.   | "tiley"
  644.   | "rot"
  645.   | "health"
  646.   | "maxhealth"
  647.   | "armor"
  648.   | "money"
  649.   | "score"
  650.   | "deaths"
  651.   | "teamkills"
  652.   | "hostagekills"
  653.   | "teambuildingkills"
  654.   | "mvp"
  655.   | "assists"
  656.   | "ping"
  657.   | "idle"
  658.   | "speedmod"
  659.   | "spectating"
  660.   | "ai_flash"
  661.   | "weapontype"
  662.   | "weaponmode"
  663.   | "process"
  664.   | "votekick"
  665.   | "votemap";
  666. declare type PlayerValueTable =
  667.   | "table"
  668.   | "tableliving"
  669.   | "team1"
  670.   | "team2"
  671.   | "team1living"
  672.   | "team2living";
  673. /**
  674.  * Values that can be passed onto as a parameter to the 'stats' function.
  675.  */
  676. declare type StatsValueBoolean =
  677.   | "exists"
  678.   | "rank"
  679.   | "killsperdeath"
  680.   | "score"
  681.   | "frags"
  682.   | "deaths"
  683.   | "secs"
  684.   | "mvp"
  685.   | "assists";
  686. declare type StatsValueNumbers =
  687.   | "rank"
  688.   | "killsperdeath"
  689.   | "score"
  690.   | "frags"
  691.   | "deaths"
  692.   | "secs"
  693.   | "mvp"
  694.   | "assists";
  695. /**
  696.  * Values that can be passed onto as a parameter to the 'projectile' function.
  697.  */
  698. declare type ProjectileValue =
  699.   | "exists"
  700.   | "type"
  701.   | "x"
  702.   | "y"
  703.   | "dir"
  704.   | "rot"
  705.   | "flydist"
  706.   | "time";
  707. /**
  708.  * Values that can be passed onto as a parameter to the 'tile' function.
  709.  */
  710. declare type TileValueBoolean =
  711.   | "walkable"
  712.   | "deadly"
  713.   | "wall"
  714.   | "obstacle"
  715.   | "hascustomframe";
  716. declare type TileValueNumbers =
  717.   | "frame"
  718.   | "property"
  719.   | "entity"
  720.   | "originalframe"
  721.   | "rot"
  722.   | "blend"
  723.   | "brightness";
  724. declare type TileValueTable = "color";
  725. declare type TileValue = TileValueBoolean | TileValueNumbers | TileValueTable;
  726. /**
  727.  * Numeric types of Objects
  728.  */
  729. declare type ObjectType =
  730.   | 1
  731.   | 2
  732.   | 3
  733.   | 4
  734.   | 5
  735.   | 6
  736.   | 7
  737.   | 8
  738.   | 9
  739.   | 10
  740.   | 11
  741.   | 12
  742.   | 13
  743.   | 14
  744.   | 15
  745.   | 20
  746.   | 21
  747.   | 22
  748.   | 23
  749.   | 30
  750.   | 40;
  751. /**
  752.  * Numeric types of Tile Properties
  753.  */
  754. declare type TilePropertyType =
  755.   | 0
  756.   | 1
  757.   | 2
  758.   | 3
  759.   | 4
  760.   | 5
  761.   | 10
  762.   | 11
  763.   | 12
  764.   | 13
  765.   | 14
  766.   | 15
  767.   | 16
  768.   | 50
  769.   | 51
  770.   | 52
  771.   | 53;
  772. /**
  773.  * Image Covered By Player
  774.  *
  775.  * draw at player, covered by player (player id+100)
  776.  *
  777.  * Image Mode 101-132
  778.  */
  779. declare type ImageModeCoveredByPlayer =
  780.   | 101
  781.   | 102
  782.   | 103
  783.   | 104
  784.   | 105
  785.   | 106
  786.   | 107
  787.   | 108
  788.   | 109
  789.   | 110
  790.   | 111
  791.   | 112
  792.   | 113
  793.   | 114
  794.   | 115
  795.   | 116
  796.   | 117
  797.   | 118
  798.   | 119
  799.   | 120
  800.   | 121
  801.   | 122
  802.   | 123
  803.   | 124
  804.   | 125
  805.   | 126
  806.   | 127
  807.   | 128
  808.   | 129
  809.   | 130
  810.   | 131
  811.   | 132;
  812. /**
  813.  * Image Covering the Player
  814.  *
  815.  * draw at player, covering player (player id+200)
  816.  *
  817.  * Image Mode 201-232
  818.  */
  819. declare type ImageModeCoveringPlayer =
  820.   | 201
  821.   | 202
  822.   | 203
  823.   | 204
  824.   | 205
  825.   | 206
  826.   | 207
  827.   | 208
  828.   | 209
  829.   | 210
  830.   | 211
  831.   | 212
  832.   | 213
  833.   | 214
  834.   | 215
  835.   | 216
  836.   | 217
  837.   | 218
  838.   | 219
  839.   | 220
  840.   | 221
  841.   | 222
  842.   | 223
  843.   | 224
  844.   | 225
  845.   | 226
  846.   | 227
  847.   | 228
  848.   | 229
  849.   | 230
  850.   | 231
  851.   | 232;
  852. /**
  853.  * Image Covering the Players & Entities
  854.  *
  855.  * draw at player, covering player and entity images (player id+132)
  856.  *
  857.  * Image Mode 133-164
  858.  */
  859. declare type ImageModeCoveringPlayerAndEntity =
  860.   | 133
  861.   | 134
  862.   | 135
  863.   | 136
  864.   | 137
  865.   | 138
  866.   | 139
  867.   | 140
  868.   | 141
  869.   | 142
  870.   | 143
  871.   | 144
  872.   | 145
  873.   | 146
  874.   | 147
  875.   | 148
  876.   | 149
  877.   | 150
  878.   | 151
  879.   | 152
  880.   | 153
  881.   | 153
  882.   | 154
  883.   | 155
  884.   | 156
  885.   | 157
  886.   | 158
  887.   | 159
  888.   | 160
  889.   | 161
  890.   | 162
  891.   | 163
  892.   | 164;
  893. /**
  894.  * All Image Modes
  895.  *
  896.  *
  897.  * * Mode 0 - floor image (covered by players etc)
  898.  *
  899.  * * Mode 1 - top image (covering players)
  900.  *
  901.  * * Mode 2 - HUD image (covering everything, part of the interface, affected by mp_hudscale)
  902.  *
  903.  * * Mode 3 - super top image (covering everything on the map)
  904.  *
  905.  * * Mode 4 - background image (covering only the background)
  906.  *
  907.  * * Mode 101-132 - draw at player, covered by player (player id+100)
  908.  *
  909.  * * Mode 201-232 - draw at player, covering player (player id+200)
  910.  *
  911.  * * Mode 133-164 - draw at player, covering player and entity images (player id+132)
  912.  *
  913.  * Image Mode 0..4, 101..132, 133..164, 201..232
  914.  */
  915. declare type ImageMode =
  916.   | 0
  917.   | 1
  918.   | 2
  919.   | 3
  920.   | 4
  921.   | ImageModeCoveredByPlayer
  922.   | ImageModeCoveringPlayer
  923.   | ImageModeCoveringPlayerAndEntity;
  924. /**
  925.  * Image Hit Zone Modes
  926.  */
  927. declare type ImageHitzoneMode = 0 | 1 | 2 | 3 | 4 | 101 | 102 | 103 | 104;
  928. /**
  929.  * Changes the blendmode of an image:
  930.  *
  931.  * >0 for normal (pixels are alpha blended, default mode)
  932.  *
  933.  * >1 for light (pixels are added)
  934.  *
  935.  * >2 for shade (pixels are multiplied)
  936.  *
  937.  * >3 for solid (pixels are overwritten, alpha transparency is ignored)
  938.  */
  939. declare type BlendMode = 0 | 1 | 2 | 3;
  940. /**
  941.  * Weapon ID's for Pistols
  942.  * --
  943.  * * 1 - USP
  944.  *
  945.  * * 2 - Glock
  946.  *
  947.  * * 3 - Deagle
  948.  *
  949.  * * 4 - P228
  950.  *
  951.  * * 5 - Elite
  952.  *
  953.  * * 6 - Five-Seven
  954.  */
  955. declare type WeaponItemTypePistol = 1 | 2 | 3 | 4 | 5 | 6;
  956. /**
  957.  * Weapon ID's for Shotguns
  958.  * --
  959.  * * 10 - M3
  960.  *
  961.  * * 11 - XM1014
  962.  */
  963. declare type WeaponItemTypeShotgun = 10 | 11;
  964. /**
  965.  * Weapon ID's for SMG's
  966.  * --
  967.  * * 20 - MP5
  968.  *
  969.  * * 21 - TMP
  970.  *
  971.  * * 22 - P90
  972.  *
  973.  * * 23 - MAC10
  974.  *
  975.  * * 24 - UMP45
  976.  */
  977. declare type WeaponItemTypeSMG = 20 | 21 | 22 | 23 | 24;
  978. /**
  979.  * Weapon ID's for the Big Guns!
  980.  * --
  981.  * * 40 - M249
  982.  *
  983.  * * 45 - Laser
  984.  *
  985.  * * 46 - Flamethrower
  986.  *
  987.  * * 47 - RPG Launcher
  988.  *
  989.  * * 48 - Rocket Launcher
  990.  *
  991.  * * 49 - Grenade Launcher
  992.  *
  993.  * * 88 - Portal Gun
  994.  *
  995.  * * 90 - M134
  996.  */
  997. declare type WeaponItemTypeBigGuns = 40 | 45 | 46 | 47 | 48 | 49 | 88 | 90;
  998. /**
  999.  * Weapon ID's for Rifles
  1000.  * --
  1001.  * * 30 - AK-47
  1002.  *
  1003.  * * 31 - SG552
  1004.  *
  1005.  * * 32 - M4A1
  1006.  *
  1007.  * * 33 - AUG
  1008.  *
  1009.  * * 34 - SCOUT
  1010.  *
  1011.  * * 35 - AWP
  1012.  *
  1013.  * * 36 - G3SG1
  1014.  *
  1015.  * * 37 - SG550
  1016.  *
  1017.  * * 38 - GALIL
  1018.  *
  1019.  * * 39 - FAMAS
  1020.  *
  1021.  * * 91 - FN F2000
  1022.  */
  1023. declare type WeaponItemTypeRifle =
  1024.   | 30
  1025.   | 31
  1026.   | 32
  1027.   | 33
  1028.   | 34
  1029.   | 35
  1030.   | 36
  1031.   | 37
  1032.   | 38
  1033.   | 39
  1034.   | 91;
  1035.  
  1036. /**
  1037.  * Weapon ID's for Melees
  1038.  * --
  1039.  * * 50 - Knife
  1040.  *
  1041.  * * 69 - Machete
  1042.  *
  1043.  * * 74 - Wrench
  1044.  *
  1045.  * * 78 - Claw
  1046.  *
  1047.  * * 85 - Chainsaw
  1048.  */
  1049. declare type WeaponItemTypeMelee = 50 | 69 | 74 | 78 | 85;
  1050. /**
  1051.  * Weapon ID's for Grenades
  1052.  * --
  1053.  * * 51 - HE (Hand Grenade)
  1054.  *
  1055.  * * 52 - Flashbang
  1056.  *
  1057.  * * 53 - Smoke Grenade
  1058.  *
  1059.  * * 54 - Flare
  1060.  *
  1061.  * * 72 - Gas Grenade
  1062.  *
  1063.  * * 73 - Molotov Cocktail
  1064.  *
  1065.  * * 75 - Snowball
  1066.  *
  1067.  * * 76 - Air Strike
  1068.  *
  1069.  * * 86 - Gut Bumb
  1070.  *
  1071.  * * 89 - Satchel Charge
  1072.  */
  1073. declare type WeaponItemTypeGrenades =
  1074.   | 51
  1075.   | 52
  1076.   | 53
  1077.   | 54
  1078.   | 72
  1079.   | 73
  1080.   | 75
  1081.   | 76
  1082.   | 86
  1083.   | 89;
  1084. /**
  1085.  * Weapon ID's for Mines
  1086.  * --
  1087.  * * 77 - Mine (Land mine)
  1088.  *
  1089.  * * 87 - Laser Mine
  1090.  */
  1091. declare type WeaponItemTypeMines = 77 | 87;
  1092. /**
  1093.  * Weapon ID's for Equipment
  1094.  * --
  1095.  * * 41 - Tactical Shield
  1096.  *
  1097.  * * 56 - Defuse Kit
  1098.  *
  1099.  * * 57 - Kevlar (+65 AP)
  1100.  *
  1101.  * * 58 - Kevlar + Helm (+100 AP)
  1102.  *
  1103.  * * 59 - Night Vision
  1104.  *
  1105.  * * 60 - Gas Mask
  1106.  *
  1107.  * * 61 - Primary Ammo
  1108.  *
  1109.  * * 62 - Secondary Ammo
  1110.  */
  1111. declare type WeaponItemTypeEquipment = 41 | 56 | 57 | 58 | 59 | 60 | 61 | 62;
  1112. /**
  1113.  * Weapon ID's for Misc Stuff
  1114.  * --
  1115.  * * 55 - Bomb
  1116.  *
  1117.  * * 63 - Planted Bomb
  1118.  *
  1119.  * * 64 - Medikit (Full HP)
  1120.  *
  1121.  * * 65 - Bandage (+20 HP)
  1122.  *
  1123.  * * 66 - Coins (+100)
  1124.  *
  1125.  * * 67 - Money (+500)
  1126.  *
  1127.  * * 68 - Gold (+1000)
  1128.  *
  1129.  * * 70 - Red Flag
  1130.  *
  1131.  * * 71 - Blue Flag
  1132.  */
  1133. declare type WeaponItemTypeStuff = 55 | 63 | 64 | 65 | 66 | 67 | 68 | 70 | 71;
  1134. /**
  1135.  * Weapon ID's for Armor
  1136.  * --
  1137.  * * 79 - Light Armor (-25% dmg)
  1138.  *
  1139.  * * 80 - Armor (-50% dmg)
  1140.  *
  1141.  * * 81 - Heavy Armor (-75% dmg)
  1142.  *
  1143.  * * 82 - Medic Armor (-50% dmg & +10 HP/s)
  1144.  *
  1145.  * * 83 - Super Armor (-95% dmg)
  1146.  *
  1147.  * * 84 - Stealth Suit (No Change)
  1148.  */
  1149. declare type WeaponItemTypeArmor = 79 | 80 | 81 | 82 | 83 | 84;
  1150. /**
  1151.  * Weapon ID's for Pistols
  1152.  * --
  1153.  *
  1154.  * * 1 - USP
  1155.  *
  1156.  * * 2 - Glock
  1157.  *
  1158.  * * 3 - Deagle
  1159.  *
  1160.  * * 4 - P228
  1161.  *
  1162.  * * 5 - Elite
  1163.  *
  1164.  * * 6 - Five-Seven
  1165.  *
  1166.  * ---
  1167.  * Weapon ID's for Shotguns
  1168.  * --
  1169.  * * 10 - M3
  1170.  *
  1171.  * * 11 - XM1014
  1172.  *
  1173.  * ---
  1174.  * Weapon ID's for SMG's
  1175.  * --
  1176.  * * 20 - MP5
  1177.  *
  1178.  * * 21 - TMP
  1179.  *
  1180.  * * 22 - P90
  1181.  *
  1182.  * * 23 - MAC10
  1183.  *
  1184.  * * 24 - UMP45
  1185.  *
  1186.  * ---
  1187.  * Weapon ID's for Rifles
  1188.  * --
  1189.  * * 30 - AK-47
  1190.  *
  1191.  * * 31 - SG552
  1192.  *
  1193.  * * 32 - M4A1
  1194.  *
  1195.  * * 33 - AUG
  1196.  *
  1197.  * * 34 - SCOUT
  1198.  *
  1199.  * * 35 - AWP
  1200.  *
  1201.  * * 36 - G3SG1
  1202.  *
  1203.  * * 37 - SG550
  1204.  *
  1205.  * * 38 - GALIL
  1206.  *
  1207.  * * 39 - FAMAS
  1208.  *
  1209.  * * 91 - FN F2000
  1210.  *
  1211.  * ---
  1212.  * Weapon ID's for the Big Guns!
  1213.  * ---
  1214.  * * 40 - M249
  1215.  *
  1216.  * * 45 - Laser
  1217.  *
  1218.  * * 46 - Flamethrower
  1219.  *
  1220.  * * 47 - RPG Launcher
  1221.  *
  1222.  * * 48 - Rocket Launcher
  1223.  *
  1224.  * * 49 - Grenade Launcher
  1225.  *
  1226.  * * 88 - Portal Gun
  1227.  *
  1228.  * * 90 - M134
  1229.  *
  1230.  * ---
  1231.  * Weapon ID's for Melees
  1232.  * --
  1233.  * * 50 - Knife
  1234.  *
  1235.  * * 69 - Machete
  1236.  *
  1237.  * * 74 - Wrench
  1238.  *
  1239.  * * 78 - Claw
  1240.  *
  1241.  * * 85 - Chainsaw
  1242.  *
  1243.  * ---
  1244.  * Weapon ID's for Grenades
  1245.  * --
  1246.  * * 51 - HE (Hand Grenade)
  1247.  *
  1248.  * * 52 - Flashbang
  1249.  *
  1250.  * * 53 - Smoke Grenade
  1251.  *
  1252.  * * 54 - Flare
  1253.  *
  1254.  * * 72 - Gas Grenade
  1255.  *
  1256.  * * 73 - Molotov Cocktail
  1257.  *
  1258.  * * 75 - Snowball
  1259.  *
  1260.  * * 76 - Air Strike
  1261.  *
  1262.  * * 86 - Gut Bumb
  1263.  *
  1264.  * * 89 - Satchel Charge
  1265.  *
  1266.  * ---
  1267.  * Weapon ID's for Mines
  1268.  * --
  1269.  * * 77 - Mine (Land mine)
  1270.  *
  1271.  * * 87 - Laser Mine
  1272.  *
  1273.  * ---
  1274.  * Weapon ID's for Equipment
  1275.  * --
  1276.  * * 41 - Tactical Shield
  1277.  *
  1278.  * * 56 - Defuse Kit
  1279.  *
  1280.  * * 57 - Kevlar (+65 AP)
  1281.  *
  1282.  * * 58 - Kevlar + Helm (+100 AP)
  1283.  *
  1284.  * * 59 - Night Vision
  1285.  *
  1286.  * * 60 - Gas Mask
  1287.  *
  1288.  * * 61 - Primary Ammo
  1289.  *
  1290.  * * 62 - Secondary Ammo
  1291.  *
  1292.  * ---
  1293.  * Weapon ID's for Misc Stuff
  1294.  * --
  1295.  * * 55 - Bomb
  1296.  *
  1297.  * * 63 - Planted Bomb
  1298.  *
  1299.  * * 64 - Medikit (Full HP)
  1300.  *
  1301.  * * 65 - Bandage (+20 HP)
  1302.  *
  1303.  * * 66 - Coins (+100)
  1304.  *
  1305.  * * 67 - Money (+500)
  1306.  *
  1307.  * * 68 - Gold (+1000)
  1308.  *
  1309.  * * 70 - Red Flag
  1310.  *
  1311.  * * 71 - Blue Flag
  1312.  *
  1313.  * ---
  1314.  * Weapon ID's for Armor
  1315.  * --
  1316.  * * 79 - Light Armor (-25% dmg)
  1317.  *
  1318.  * * 80 - Armor (-50% dmg)
  1319.  *
  1320.  * * 81 - Heavy Armor (-75% dmg)
  1321.  *
  1322.  * * 82 - Medic Armor (-50% dmg & +10 HP/s)
  1323.  *
  1324.  * * 83 - Super Armor (-95% dmg)
  1325.  *
  1326.  * * 84 - Stealth Suit (No Change)
  1327.  *
  1328.  */
  1329. declare type WeaponItemType =
  1330.   | WeaponItemTypePistol
  1331.   | WeaponItemTypeShotgun
  1332.   | WeaponItemTypeSMG
  1333.   | WeaponItemTypeRifle
  1334.   | WeaponItemTypeBigGuns
  1335.   | WeaponItemTypeMelee
  1336.   | WeaponItemTypeGrenades
  1337.   | WeaponItemTypeMines
  1338.   | WeaponItemTypeEquipment
  1339.   | WeaponItemTypeStuff
  1340.   | WeaponItemTypeArmor;
  1341.  
  1342. /**
  1343.  * Adds a Lua key bind for the specified key. This bind will be active for all players and will trigger the key-hook when a player presses or releases the related key.
  1344.  *
  1345.  * Returns 1 if adding the key bind worked, 0 otherwise (invalid key name / already bound).
  1346.  */
  1347. declare function addbind(key: BindKeyValue): 0 | 1;
  1348. /**
  1349.  * Attaches the Lua function "func" to the hook "hook". CS2D will always call that Lua function when the event related to that hook occurs.
  1350.  *
  1351.  * You can add an unlimited amount of different functions to each hook - but bear in mind that this might affect the performance in a negative way. Especially for hooks which are called frequently.
  1352.  */
  1353. declare function addhook(
  1354.   hook: HookValue,
  1355.   func: string,
  1356.   priority?: number,
  1357. ): void;
  1358. /**
  1359.  * Bot with given ID aims at the given position (x|y) on the map (in pixels).
  1360.  */
  1361. declare function ai_aim(id: PlayerID, x: number, y: number): void;
  1362. /**
  1363.  * Bot with given ID performs an attack. Set secondary to 1 to use the secondary weapon function (=attack2) instead of the primary function.
  1364.  */
  1365. declare function ai_attack(id: PlayerID, secondary?: number): void;
  1366. /**
  1367.  * Bot with given ID tries to purchase a certain item
  1368.  */
  1369. declare function ai_buy(id: PlayerID, itemtype: WeaponItemType): void;
  1370. /**
  1371.  * Set debug-text for bot (only displayed if "debugai" is enabled).
  1372.  */
  1373. declare function ai_debug(id: PlayerID, text: string): void;
  1374. /**
  1375.  * Bot with given ID drops the current weapon.
  1376.  */
  1377. declare function ai_drop(id: PlayerID): void;
  1378. /**
  1379.  * Returns the ID of the closest enemy to the player with the specified ID or 0 when no enemy was found.
  1380.  *
  1381.  * Only players which are close enough (inside the virtual screen of the player) will be returned.
  1382.  *
  1383.  * When fog of war is enabled players behind walls won't be returned.
  1384.  */
  1385. declare function ai_findtarget(id: PlayerID): number;
  1386. /**
  1387.  * Checks if there is a free line between the bot with the given ID and the given position (x|y) (in pixels).
  1388.  */
  1389. declare function ai_freeline(id: PlayerID, x: number, y: number): boolean;
  1390. /**
  1391.  * Bot with the given ID goes to tile (x|y). Set walk to 1 to let it walk (silent).
  1392.  *
  1393.  * @Returns {0, 1 or 2}
  1394.  *
  1395.  * >0 - when failed to find path,
  1396.  *
  1397.  * >1 - when target is reached or
  1398.  *
  1399.  * >2 - when bot is still on its way.
  1400.  */
  1401. declare function ai_goto(
  1402.   id: PlayerID,
  1403.   x: number,
  1404.   y: number,
  1405.   walk?: number,
  1406. ): 0 | 1 | 2;
  1407. /**
  1408.  * Bot with given ID performs an intelligent attack.
  1409.  *
  1410.  * This includes some additional logic:
  1411.  *
  1412.  * >If the current weapon has limited ammo, is empty and has spare ammo, a reload will be triggered and attacking will continue after reloading
  1413.  *
  1414.  * >If the current weapon is entirely empty (no spare ammo), switch to the next best weapon which can be used for attacking (in most cases pistol or melee)
  1415.  */
  1416. declare function ai_iattack(id: PlayerID): void;
  1417. /**
  1418.  * Bot with given ID moves into a certain direction (defined with the given angle from 0° to 360°).
  1419.  *
  1420.  * Set walk to 1 to let it walk.
  1421.  *
  1422.  * Returns 1 when successful or 0 when way is blocked.
  1423.  */
  1424. declare function ai_move(id: PlayerID, angle: number, walk?: 0 | 1): 0 | 1;
  1425. /**
  1426.  * Bot with given ID sends a radio message.
  1427.  */
  1428. declare function ai_radio(id: PlayerID, radioid: number): void;
  1429. /**
  1430.  * Bot with given ID reloads the current weapon.
  1431.  */
  1432. declare function ai_reload(id: PlayerID): void;
  1433. /**
  1434.  * Bot with given ID respawns (only if dead and only if game mode allows it).
  1435.  */
  1436. declare function ai_respawn(id: PlayerID): void;
  1437. /**
  1438.  * Bot with given ID instantly turns to certain direction/angle (from 0° to 360°).
  1439.  */
  1440. declare function ai_rotate(id: PlayerID, angle: number): void;
  1441. /**
  1442.  * Bot with given ID says the given text using the chat system.
  1443.  */
  1444. declare function ai_say(id: PlayerID, text: string): void;
  1445. /**
  1446.  * Bot with given ID says the given text to the own team only (using team chat).
  1447.  */
  1448. declare function ai_sayteam(id: PlayerID, text: string): void;
  1449. /**
  1450.  * Bot with given ID selects the weapon specified with itemtype.
  1451.  */
  1452. declare function ai_selectweapon(id: PlayerID, itemtype: WeaponItemType): void;
  1453. /**
  1454.  * Bot with given ID sprays a spraylogo at its current position.
  1455.  */
  1456. declare function ai_spray(id: PlayerID): void;
  1457. /**
  1458.  * Bot with given ID uses the environement (like pressing use-key).
  1459.  */
  1460. declare function ai_use(id: PlayerID): void;
  1461. /**
  1462.  * Returns the SHA256 checksum of the file at this path.
  1463.  */
  1464. declare function checksumfile(path: string): void;
  1465. /**
  1466.  * Returns the SHA256 checksum of the given string.
  1467.  */
  1468. declare function checksumstring(string: string): void;
  1469. /**
  1470.  * Returns the tile x and y position (2 values!) of the closest living and unused hostage to a given player. Returns -100,-100 if no hostage has been found.
  1471.  *
  1472.  * Note: The returned position is in tiles, NOT in pixels!
  1473.  * @tupleReturn
  1474.  */
  1475. declare function closehostage(playerid: PlayerID): [number, number];
  1476. /**
  1477.  * Returns a Lua table with all IDs of items which are close to the player specified with the id parameter.
  1478.  *
  1479.  * Only dropped items which are within the range will be returned.
  1480.  *
  1481.  * The unit for the range is tiles (range 1 equals 32 pixels for example).
  1482.  */
  1483. declare function closeitems(id: number, range: number): number[];
  1484. /**
  1485.  * Returns a list of objects which are within the specified radius (in pixels) around the specified position (X|Y) in pixels.
  1486.  *
  1487.  * Use type to limit the search to objects with a certain type only.
  1488.  */
  1489. declare function closeobjects(
  1490.   x: number,
  1491.   y: number,
  1492.   radius: number,
  1493.   type?: ObjectType,
  1494. ): number[];
  1495. /**
  1496.  * Returns a list of all alive players (IDs) which are within the specified radius (in pixels) around the specified position (x|y) in pixels
  1497.  */
  1498. declare function closeplayers(
  1499.   x: number,
  1500.   y: number,
  1501.   radius: number,
  1502.   team?: 0 | 1 | 2,
  1503. ): PlayerID[];
  1504. /**
  1505.  * Returns a value of an entity at the tile position (X|Y).
  1506.  *
  1507.  * Note: There is no entity(0,"table") as it is common for comparable commands! Use the command "entitylist" instead!
  1508.  */
  1509. declare function entity(
  1510.   x: number,
  1511.   y: number,
  1512.   value: EntityValue,
  1513. ): string | boolean | number;
  1514. /**
  1515.  * Returns a list (Lua table) containing the positions (as X and Y tile coordinates) of all entities (except for Env_Decal).
  1516.  *
  1517.  * You can also limit the output to a certain entity type by using the optional type parameter.
  1518.  *
  1519.  * Note: The resulting "list" is actually a Lua table with one sub Lua table per entity in it. The sub tables have the fields/indices "x" and "y" which contain the X and Y tile coordinates of an entity.
  1520.  *
  1521.  * Attention: Env_Decal entities are NOT included in this list!
  1522.  */
  1523. declare function entitylist(type?: number): { x: number; y: number };
  1524. /**
  1525.  * Removes a function from a hook.
  1526.  *
  1527.  * Nothing will happen if the function has not been attached to the hook with addhook before.
  1528.  */
  1529. declare function freehook(hook: HookValue, func: string): void;
  1530. /**
  1531.  * Removes an image completely.
  1532.  *
  1533.  * Attention: The variable(s) you used to save the image ID will NOT be changed by CS2D! Please set them to nil manually!
  1534.  *
  1535.  * Attention: CS2D recycles image IDs! As soon as an image with ID X gets removed, a new image which is created afterwards might receive that very same ID again!
  1536.  * That's why it is very important to set the variable with the ID to nil to make sure that your script never tries to access this image again.
  1537.  * Otherwise your script might modify a completely different image!
  1538.  */
  1539. declare function freeimage(id: number): void;
  1540. /**
  1541.  * Removes timers which call the specified "func" with the specified "param".
  1542.  *
  1543.  * If "param" is not set (or ""), all timers with the matching "func" will be removed.
  1544.  *
  1545.  * If neither "func" nor "param" is set (or if both are ""), this will remove ALL existing timers.
  1546.  *
  1547.  * Once a timer has been removed it won't be executed anymore.
  1548.  *
  1549.  * Of course you can create the same time again if you want to.
  1550.  *
  1551.  * Note: You do not have to remove timers with a limited call count manually. They will remove themselves when they expire.
  1552.  *
  1553.  * Attention: Be very careful with the parameters. If both are empty / empty strings (""), you will remove ALL timers!
  1554.  */
  1555. declare function freetimer(func?: string, param?: string): void;
  1556. /**
  1557.  * Shows Lua functions in the Lua main table in the console of CS2D. For debugging purposes only.
  1558.  */
  1559. declare function funcs(): void;
  1560. /**
  1561.  * Returns a game state/setting.
  1562.  */
  1563. declare function game(value: GameValue): string | number | boolean;
  1564. /**
  1565.  * Checks if any alive player is within the specified radius (in pixels) around the specified position (x|y) in pixels.
  1566.  *
  1567.  * Returns a boolean true, if at least one player matching the criteria was found. Otherwise false.
  1568.  */
  1569. declare function hascloseplayers(
  1570.   x: number,
  1571.   y: number,
  1572.   radius: number,
  1573.   team?: 0 | 1 | 2,
  1574. ): boolean;
  1575. /**
  1576.  * Returns a value of a hostage:
  1577.  *
  1578.  * hostage(0, "table"): a Lua table with all hostage IDs
  1579.  */
  1580. declare function hostage(id: number, value: HostageValueBoolean): boolean;
  1581. declare function hostage(id: number, value: HostageValueNumbers): number;
  1582. declare function hostage(id: number, value: HostageValueTable): number[];
  1583. /**
  1584.  * Creates an image (dynamic object) on the map and returns the ID for that image.
  1585.  *
  1586.  * The path is relative to the CS2D folder. The position is defined via x and y in pixels. mode defines how the image is displayed (see list below).
  1587.  *
  1588.  * Use the optional player parameter if you want the image to be visible to a certain player only (it's visible to all players by default).
  1589.  */
  1590. declare function image(
  1591.   path: string,
  1592.   x: number,
  1593.   y: number,
  1594.   mode: ImageMode,
  1595.   player?: number,
  1596. ): number;
  1597. /**
  1598.  * Changes the opacity (also known as alpha, 0.0 transparent - 1.0 opaque) of an image.
  1599.  *
  1600.  * This can either be used to make an image (semi-)transparent / fully opaque or to temporarily hide an image completely (alpha 0).
  1601.  */
  1602. declare function imagealpha(id: number, alpha: number): void;
  1603. /**
  1604.  * Changes the blendmode of an image:
  1605.  *
  1606.  * >0 for normal (pixels are alpha blended, default mode)
  1607.  *
  1608.  * >1 for light (pixels are added)
  1609.  *
  1610.  * >2 for shade (pixels are multiplied)
  1611.  *
  1612.  * >3 for solid (pixels are overwritten, alpha transparency is ignored)
  1613.  */
  1614. declare function imageblend(id: number, mode: BlendMode): void;
  1615.  
  1616. declare function imageshadow(id: number, shadow: number): void;
  1617. /**
  1618.  * Changes the color of an image (use a colorpicker to get the values).
  1619.  *
  1620.  * The color is specified as red, green and blue values. Each ranging from 0 (black) to 255 (full color brightness)
  1621.  */
  1622. declare function imagecolor(
  1623.   id: number,
  1624.   red: number,
  1625.   green: number,
  1626.   blue: number,
  1627. ): void;
  1628. /**
  1629.  * Changes the frame of the spritesheet image with the specified id. Has no effect if the image is not a spritesheet.
  1630.  *
  1631.  * The frame starts with 1 for the first frame. If you attempt to set the frame lower than 1 or larger than the maximum number of frames, the frame will be set to the first or last frame respectively.
  1632.  *
  1633.  * The frames are numbered from left to right and from top to bottom. So the top left frame is frame number 1 and the bottom right frame is the last frame.
  1634.  */
  1635. declare function imageframe(id: number, frame: number): void;
  1636. /**
  1637.  * Adds, removes or modifies a hit zone for an image which reacts to shots/attacks
  1638.  *
  1639.  * Each hit zone will trigger the hitzone-hook when it is hit by a shot/attack.
  1640.  *
  1641.  * Non-Blocking Modes (<=100, shots will pass through)
  1642.  *
  1643.  * 0 - no hit zone (this removes existing hit zones, other parameters don't matter)
  1644.  *
  1645.  * 1 - hit zone without effects (just register)
  1646.  *
  1647.  * 2 - wall effect
  1648.  *
  1649.  * 3 - blood effect
  1650.  *
  1651.  * 4 - green blood effect
  1652.  *
  1653.  * Blocking Modes (>100, shots will get stopped)
  1654.  *
  1655.  * 101 - hit zone without effects + stop shot
  1656.  *
  1657.  * 102 - wall effect + stop shot
  1658.  *
  1659.  * 103 - blood effect + stop shot
  1660.  *
  1661.  * 104 - green blood effect + stop shot
  1662.  *
  1663.  * All hit zones with modes which are higher than 100 will block the shots (objects behind them will not be damaged).
  1664.  *
  1665.  * They basically behave like walls but they have no influence on player movement or vision.
  1666.  */
  1667. declare function imagehitzone(id: number, mode: ImageHitzoneMode): void;
  1668. /**
  1669.  * Returns a value of an image.
  1670.  */
  1671. declare function imageparam(id: number, value: ImageparamValueStrings): string;
  1672. declare function imageparam(id: number, value: ImageparamValueNumbers): number;
  1673. /**
  1674.  * Changes the position (x & y, pixels) and rotation (rot, 0°-360°) of an image.
  1675.  */
  1676. declare function imagepos(id: number, x: number, y: number, rot: number): void;
  1677. /**
  1678.  * Changes the image scale factors (in other words: the image size).
  1679.  */
  1680. declare function imagescale(id: number, x: number, y: number): void;
  1681. /**
  1682.  * Checks if the tile position (x|y) is inside the area of a certain entity type and returns true if this is the case and false otherwise.
  1683.  *
  1684.  * The "area" of an entity depends on the entity type and and in some cases on its properties.
  1685.  */
  1686. declare function inentityzone(x: number, y: number, type: number): boolean;
  1687. /**
  1688.  * Returns a value of an item instance on the map.
  1689.  *
  1690.  * item(0,"table"): returns a Lua table with all IDs of items which are on the map (the unique instance IDs, NOT the type IDs!)
  1691.  */
  1692. declare function item(id: number, value: "type"): WeaponItemType;
  1693. declare function item(id: number, value: WeaponItemValueBoolean): boolean;
  1694. declare function item(id: number, value: WeaponItemValueNumbers): number;
  1695. declare function item(id: number, value: WeaponItemValueStrings): string;
  1696. declare function item(id: number, value: WeaponItemValueTable): number[];
  1697. /**
  1698.  * Returns a value of an item type.
  1699.  *
  1700.  * The values are the same for all objects of that type.
  1701.  */
  1702. declare function itemtype(
  1703.   type: WeaponItemType,
  1704.   value: WeaponItemTypeValueStrings,
  1705. ): string;
  1706. declare function itemtype(
  1707.   type: WeaponItemType,
  1708.   value: WeaponItemTypeValueNumbers,
  1709. ): number;
  1710. /**
  1711.  * Returns info about the current map.
  1712.  */
  1713. declare function map(value: MapValueStrings): string;
  1714. declare function map(value: MapValueNumbers): number;
  1715. /**
  1716.  * Opens a menu on the screen of a certain player (id=player id) or at the screen of every player (id=0)!
  1717.  *
  1718.  * The 'content' string defines the look and content of the menu.
  1719.  *
  1720.  * Scheme: "title,b1,b2,...,b9"
  1721.  *
  1722.  * title = title of the menu (Attach @b at the end of title for a bigger menu or @i for an invisible menu)
  1723.  *
  1724.  * b1-b9 = up to 9 button captions. Use empty strings for buttons you don't need.
  1725.  *
  1726.  * Captions can also be split into 2 parts by using "|" (scheme: "left caption|right caption").
  1727.  *
  1728.  * Moreover you can put () around a caption to make a disabled button.
  1729.  *
  1730.  * The menu-hook is executed when a player hits a menu button with the mouse or presses the corresponding numeric key.
  1731.  */
  1732. declare function menu(id: number, content: string): void;
  1733. /**
  1734.  * Sends "text" as server message to all players. It will be displayed in the chat area of the screen (bottom left).
  1735.  *
  1736.  * You can start "text" with an RGB color code "©RRRGGGBBB" to change its color. (use a colorpicker to get the values)
  1737.  *
  1738.  * It's also possible to display the text at the center of the screen. Just end "text" with "@C" (read: at center) to do so!
  1739.  */
  1740. declare function msg(text: string | number): void;
  1741. /**
  1742.  * Sends "text" to a certain player (id) only. It will be displayed in the chat area of the screen of that player (bottom left).
  1743.  *
  1744.  * You can start "text" with an RGB color code "©RRRGGGBBB...." to change its color. (use a colorpicker to get the values)
  1745.  *
  1746.  * It's also possible to display the text at the center of the screen. Just end "text" with "@C" (read: at center) to do so!
  1747.  */
  1748. declare function msg2(player: PlayerID, text: string | number): void;
  1749. /**
  1750.  * Returns a value of a dynamic object
  1751.  *
  1752.  * object(0,"table"): a Lua table with all dynamic object IDs
  1753.  */
  1754. declare function object(id: number, value: ObjectValueBoolean): boolean;
  1755. declare function object(id: number, value: ObjectValueNumbers): number;
  1756. declare function object(id: number, value: ObjectValueTable): number[];
  1757. /**
  1758.  * Returns the ID of the first object which is found at the tile position (X|Y) and which has the specified type.
  1759.  *
  1760.  * The function will return the first object of any type at this position if no type is specified.
  1761.  *
  1762.  * The function returns 0 if nothing is found at the specified position / with the specified type.
  1763.  */
  1764. declare function objectat(x: number, y: number, type: ObjectType): number;
  1765. /**
  1766.  * Returns a value of an object type (NOT an object instance on the map).
  1767.  *
  1768.  * The values are the same for all objects of that type.
  1769.  */
  1770. declare function objecttype(
  1771.   type: ObjectType,
  1772.   value: ObjectTypeValueStrings,
  1773. ): string;
  1774. declare function objecttype(
  1775.   type: ObjectType,
  1776.   value: ObjectTypeValueNumbers,
  1777. ): number;
  1778. /**
  1779.  * Executes ordinary non-Lua CS2D commands.
  1780.  *
  1781.  * Everything behind the first semicolon (;) will be ignored.
  1782.  *
  1783.  * This is a security measurement in case you're using user input (like chat messages) with this command.
  1784.  *
  1785.  * You can change this behavior by setting Stop-At-Semicolon to 0.
  1786.  */
  1787. declare function parse(commands: string, stopAtSemicolon?: number): void;
  1788. /**
  1789.  * Returns a value of a player or a table of players. Returns false if the specified player, value or table does not exist.
  1790.  */
  1791. declare function player(player: PlayerID, value: PlayerValueBoolean): boolean;
  1792. declare function player(player: PlayerID, value: PlayerValueStrings): string;
  1793. declare function player(player: PlayerID, value: PlayerValueNumbers): number;
  1794. declare function player(player: PlayerID, value: PlayerValueTable): PlayerID[];
  1795. /**
  1796.  * Returns how much ammo the specified player has left in the specified weapon.
  1797.  *
  1798.  * Returns two values:
  1799.  *
  1800.  * >The ammo currently loaded into the weapon and
  1801.  *
  1802.  * >the spare ammo for reloading
  1803.  *
  1804.  * @tupleReturn
  1805.  */
  1806. declare function playerammo(
  1807.   id: PlayerID,
  1808.   itemtype: WeaponItemType,
  1809. ): [number, number];
  1810. /**
  1811.  * Returns a Lua table with all equippable weapon/item TYPES a player carries.
  1812.  */
  1813. declare function playerweapons(id: PlayerID): WeaponItemType[];
  1814. /**
  1815.  * Shows text in console.
  1816.  *
  1817.  * You can start "text" with an RGB color code "©RRRGGGBBB" to change its color. (use a colorpicker to get the values)
  1818.  */
  1819. declare function print(...args: never[]): void;
  1820. /**
  1821.  * Returns a value of a projectile (projectiles are grenades and most stuff launched by weapons which is visible for multiple frames.
  1822.  * Regular bullets are NO projectiles though)
  1823.  */
  1824. declare function projectile(
  1825.   id: number,
  1826.   player: PlayerID,
  1827.   value: ProjectileValue,
  1828. ): string | number | boolean;
  1829. /**
  1830.  * Returns a list (Lua table) containing projectile key data (IDs and parent player) of all flying or ground projectiles.
  1831.  *
  1832.  * You can also limit the output to the projectiles of a certain player (player=0 is default and will list projectiles of all players).
  1833.  *
  1834.  * The list parameter can either be 0 (default) for all flying projectiles or 1 for all ground projectiles.
  1835.  */
  1836. declare function projectilelist(
  1837.   list?: number,
  1838.   player?: PlayerID,
  1839. ): { id: number; player: number }[];
  1840. /**
  1841.  * Returns the tile x and y position (2 values!) of a random entity of a certain type or -100,-100 if no entity has been found.
  1842.  *
  1843.  * Use AI-State to only find entities with this AI state (-1 or omit to ignore the AI-state).
  1844.  *
  1845.  * Use int0 to only find entities with this int0 value (-1 or omit to ignore the int0 value).
  1846.  *
  1847.  * @tupleReturn
  1848.  */
  1849. declare function randomentity(
  1850.   type: number,
  1851.   aiState?: number,
  1852.   int0?: number,
  1853. ): [number, number];
  1854. /**
  1855.  * Returns the tile x and y position (2 values!) of a random living and unused (not following anyone) hostage. Returns -100,-100 if no hostage has been found.
  1856.  *
  1857.  * Set unused to 0 if you want to get used hostages as well!
  1858.  *
  1859.  * @tupleReturn
  1860.  */
  1861. declare function randomhostage(unused?: number): void;
  1862. /**
  1863.  * Removes all Lua key binds. This will entirely disable all additional network traffic caused by key binds and the key-hook won't be called anymore.
  1864.  */
  1865. declare function removeallbinds(): void;
  1866. /**
  1867.  * Removes a specific Lua key bind. They key must have been added beforehand with addbind.
  1868.  *
  1869.  * Returns 1 if the bind was removed, 0 if the bind did not exist.
  1870.  */
  1871. declare function removebind(key: BindKeyValue): 0 | 1;
  1872. /**
  1873.  * reqcld is short for "request client data". This command requests data from a single player client (id=player id) or from all clients (id=0).
  1874.  *
  1875.  * Mode specifies which data the server will receive:
  1876.  *
  1877.  * >Mode 0: Cursor position (cursor position on screen in pixels, scaled based on mp_hudscale)
  1878.  *
  1879.  * Deprecated: It is recommended to use player with parameters "mousex"/"mousey" instead!
  1880.  *
  1881.  * >Mode 1: Map scrolling (scrolling offset in pixels)
  1882.  *
  1883.  * >Mode 2: Absolute cursor position (cursor position on map in pixels, NOT influenced by mp_hudscale)
  1884.  *
  1885.  * Deprecated: It is recommended to use player with parameters "mousemapx"/"mousemapy" instead!
  1886.  *
  1887.  * >Mode 3: 1 if the client has the advanced light engine enabled, 0 otherwise (second value always 0)
  1888.  *
  1889.  * >Mode 4: 1 if the file specified with parameter (file path relative to the CS2D folder) has been loaded, 0 otherwise; checksum of the file (only if the file is under gfx/ or sfx/) as provided by checksumfile
  1890.  *
  1891.  * >Mode 5: Mod info
  1892.  *
  1893.  * >Mode 6: 1 if the client has 3D rendering (render3d) enabled, 0 otherwise (second value always 0)
  1894.  *
  1895.  * The last parameter is not required for all modes. For some modes (mode 4) it is crucial though.
  1896.  *
  1897.  * Please read the descriptions of the modes to learn when and how it is used.
  1898.  *
  1899.  * The requested data will be received with a delay. This is because it is sent over the network. You have to use the clientdata-hook to handle the incoming data!
  1900.  */
  1901. declare function reqcld(
  1902.   id: number,
  1903.   mode: 0 | 1 | 2 | 3 | 4 | 5 | 6,
  1904.   parameter?: string,
  1905. ): void;
  1906. /**
  1907.  * reqhttp is short for "request HTTP". HTTP is used to request data from web pages / web services.
  1908.  *
  1909.  * "url" = The domain name or IP e.g. "cs2d.com"
  1910.  *
  1911.  * "path" = The relative path of the thing you want to request, normally starting with a backslash. E.g. "/index.php"
  1912.  *
  1913.  * mode = Controls how you want to receive the result. 0 for a plain string, 1 for a byte array (Lua table with numbers).
  1914.  *
  1915.  * The requested data will be received with a delay. This is because it is sent over the network. You have to use the httpdata-hook to handle the incoming data!
  1916.  *
  1917.  * The command will return a unique ID for the request. The same ID will be passed to the httpdata-hook so you can match request and response.
  1918.  */
  1919. declare function reqhttp(url: string, path: string, mode: 0 | 1): number;
  1920. /**
  1921.  * Sets the AI state value of the entity at tile position (x|y). The AI state of each entity is automatically set to 0 on each round start.
  1922.  *
  1923.  * CS2D does not actively use the AI state and you can set it to any integer value you want.
  1924.  *
  1925.  * It's commonly used in AI scripts (bots) only.
  1926.  *
  1927.  * e.g.: when a bomb has been planted, bots can mark a bomb spot as checked ("bomb is not here") using the AI state. This can be used to prevent that the same spot is checked again.
  1928.  */
  1929. declare function setentityaistate(x: number, y: number, ai: number): void;
  1930. /**
  1931.  *
  1932.  */
  1933. declare function sethookstate(hook: HookValue, enable: 0 | 1): void;
  1934. /**
  1935.  * Returns stats for a U.S.G.N. account ID.
  1936.  */
  1937. declare function stats(usgnid: number, value: StatsValueBoolean): boolean;
  1938. declare function stats(usgnid: number, value: StatsValueNumbers): number;
  1939. /**
  1940.  * Returns stats for a Steam account ID (provided as string)
  1941.  */
  1942. declare function steamstats(steamid: string, value: StatsValueBoolean): boolean;
  1943. declare function steamstats(steamid: string, value: StatsValueNumbers): number;
  1944.  
  1945. /**
  1946.  * Returns a value of the tile at the tile position (X|Y)
  1947.  *
  1948.  * Property Types:
  1949.  * ---
  1950.  *
  1951.  * * 0-tile w/o sound
  1952.  *
  1953.  * * 1-wall
  1954.  *
  1955.  * * 2 - obstacle
  1956.  *
  1957.  * * 3 - wall w/o shadow
  1958.  *
  1959.  * * 4 - obstacle w/o shadow
  1960.  *
  1961.  * * 5 - floor wall
  1962.  *
  1963.  * * 10 - dirt floor
  1964.  *
  1965.  * * 11 - snow floor
  1966.  *
  1967.  * * 12 - step floor
  1968.  *
  1969.  * * 13 - tile floor
  1970.  *
  1971.  * * 14 - wade floor
  1972.  *
  1973.  * * 15 - metal floor
  1974.  *
  1975.  * * 16 - wood floor
  1976.  *
  1977.  * * 50 - deadly
  1978.  *
  1979.  * * 51 - toxic deadly
  1980.  *
  1981.  * * 52 - explosion deadly
  1982.  *
  1983.  * * 53 - abyss deadly
  1984.  *
  1985.  */
  1986. declare function tile(x: number, y: number, value: TileValueBoolean): boolean;
  1987. declare function tile(x: number, y: number, value: TileValueNumbers): number;
  1988. declare function tile(
  1989.   x: number,
  1990.   y: number,
  1991.   value: TileValueTable,
  1992. ): { r: number; g: number; b: number } | boolean;
  1993. declare function tile<T>(x: number, y: number, value: TileValue): T;
  1994. /**
  1995.  * Gets the property value for the specified tileFrame in the tileset of the current map.
  1996.  *
  1997.  * The returned property value describes the behaviour of the tile.
  1998.  *
  1999.  * Note: Will return 0 if you specify a tileFrame which is not part of the tileset!
  2000.  */
  2001. declare function tileproperty(tileframe: number): TilePropertyType;
  2002. /**
  2003.  * Creates a timer which will call the Lua function "function" after a certain time in milliseconds (time).
  2004.  *
  2005.  * Moreover it can pass an optional string parameter ("param") to this function.
  2006.  *
  2007.  * The timer calls the function once by default. However you can call it several times by entering the optional count parameter (count).
  2008.  *
  2009.  * Using 0 or negative count values will make the timer call the function infinite times or until it is removed via freetimer.
  2010.  *
  2011.  * Note: Time is specified in ms (milliseconds, 1000 ms = 1 sec)
  2012.  */
  2013. declare function timer(
  2014.   time: number,
  2015.   func: string,
  2016.   param?: string,
  2017.   count?: number,
  2018. ): void;
  2019. /**
  2020.  * Creates an alpha fade tween which changes the transparency of an image (with the specified ID).
  2021.  *
  2022.  * The image will have the given alpha transparency value after the given time!
  2023.  *
  2024.  * Alpha ranges from 0.0 (totally invisible) to 1.0 (completely opaque)
  2025.  *
  2026.  * Note: Time is specified in ms (milliseconds, 1000 ms = 1 sec)
  2027.  */
  2028. declare function tween_alpha(id: number, time: number, alpha: number): void;
  2029. /**
  2030.  * Creates an animation tween which changes the frame of the spritesheet image with the specified id constantly.
  2031.  *
  2032.  * The speed defines how many milliseconds each frame should be displayed.
  2033.  *
  2034.  * You can also specify an animation mode:
  2035.  *
  2036.  * >0 - Loop Forward (play from current frame to last frame and then continue at first frame)
  2037.  *
  2038.  * >1 - Loop Backward (play from current frame to first frame and then continue at last frame)
  2039.  *
  2040.  * >2 - Ping Pong Forward (play forward to last frame and then backward to first frame etc.)
  2041.  *
  2042.  * >3 - Ping Pong Backward (play backward to first frame and then forward to last frame etc.)
  2043.  *
  2044.  * >4 - Random (an entirely random frame is displayed every speed milliseconds)
  2045.  *
  2046.  * The tween stays active until another tween_animate or tween_frame is applied to the same image.
  2047.  *
  2048.  * Note: Speed is specified in ms (milliseconds, 1000 ms = 1 sec)
  2049.  */
  2050. declare function tween_animate(
  2051.   id: number,
  2052.   speed: number,
  2053.   mode: 0 | 1 | 2 | 3 | 4,
  2054. ): void;
  2055. /**
  2056.  * Creates a color fade tween which changes the color of an image (with the specified ID).
  2057.  *
  2058.  * The image will have the given color after the given time (use a colorpicker to get the values)!
  2059.  *
  2060.  * Note: Time is specified in ms (milliseconds, 1000 ms = 1 sec)
  2061.  */
  2062. declare function tween_color(
  2063.   id: number,
  2064.   time: number,
  2065.   r: number,
  2066.   g: number,
  2067.   b: number,
  2068. ): void;
  2069. /**
  2070.  * Creates a frame animation tween which changes the frame of a spritesheet image (with the specified ID).
  2071.  *
  2072.  * The image will have the given frame after the given time.
  2073.  *
  2074.  * Note: Time is specified in ms (milliseconds, 1000 ms = 1 sec)
  2075.  */
  2076. declare function tween_frame(id: number, time: number, frame: number): void;
  2077. /**
  2078.  * Creates a movement tween which moves the image (with the specified ID) to x,y in the given time (+rotates it if rot is specified).
  2079.  *
  2080.  * Note: Time is specified in ms (milliseconds, 1000 ms = 1 sec)
  2081.  */
  2082. declare function tween_move(
  2083.   id: number,
  2084.   time: number,
  2085.   x: number,
  2086.   y: number,
  2087.   rot?: number,
  2088. ): void;
  2089. /**
  2090.  * Creates a rotation tween which rotates the image (with the specified ID) to the angle rot in the given time.
  2091.  *
  2092.  * Note: Time is specified in ms (milliseconds, 1000 ms = 1 sec)
  2093.  */
  2094. declare function tween_rotate(id: number, time: number, rot: number): void;
  2095. /**
  2096.  * Creates a constant rotation animation which rotates an image (with the specified ID) permanently (negative speed for counter clockwise rotation)
  2097.  *
  2098.  * Note: The rotation doesn't end until another tween with rotation is applied!
  2099.  */
  2100. declare function tween_rotateconstantly(id: number, speed: number): void;
  2101. /**
  2102.  * Creates a scale tween which changes the size of an image (with the specified ID). x will be the new width factor and y the new height factor after the given time.
  2103.  *
  2104.  * Note: Time is specified in ms (milliseconds, 1000 ms = 1 sec)
  2105.  */
  2106. declare function tween_scale(
  2107.   id: number,
  2108.   time: number,
  2109.   x: number,
  2110.   y: number,
  2111. ): void;
  2112. /**
  2113.  * Shows Lua variables in the Lua main table in the console of CS2D. For debugging purposes only.
  2114.  */
  2115. declare function vars(): void;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement