[{"data":1,"prerenderedAt":1297},["ShallowReactive",2],{"navigation-docs_en":3,"\u002Fdocs\u002Fgetting-started\u002Finstall":140,"\u002Fdocs\u002Fgetting-started\u002Finstall-surround":1291,"\u002Fdocs\u002Fgetting-started\u002Finstall-current":1296},[4,35,61,91,109,123,133],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":34},"Getting started","i-lucide-rocket","\u002Fdocs\u002Fgetting-started","docs\u002F1.getting-started",[10,14,18,22,26,30],{"title":11,"path":12,"stem":13},"Introduction","\u002Fdocs\u002Fgetting-started\u002Fintroduction","docs\u002F1.getting-started\u002F01.introduction",{"title":15,"path":16,"stem":17},"Quick start","\u002Fdocs\u002Fgetting-started\u002Fquick-start","docs\u002F1.getting-started\u002F02.quick-start",{"title":19,"path":20,"stem":21},"CLI","\u002Fdocs\u002Fgetting-started\u002Fcli","docs\u002F1.getting-started\u002F03.cli",{"title":23,"path":24,"stem":25},"Installing on a server","\u002Fdocs\u002Fgetting-started\u002Finstall","docs\u002F1.getting-started\u002F04.install",{"title":27,"path":28,"stem":29},"A server in Docker","\u002Fdocs\u002Fgetting-started\u002Fdocker","docs\u002F1.getting-started\u002F05.docker",{"title":31,"path":32,"stem":33},"Limitations","\u002Fdocs\u002Fgetting-started\u002Flimitations","docs\u002F1.getting-started\u002F06.limitations",false,{"title":36,"icon":37,"path":38,"stem":39,"children":40,"page":34},"Core","i-lucide-zap","\u002Fdocs\u002Fcore","docs\u002F2.core",[41,45,49,53,57],{"title":42,"path":43,"stem":44},"Plugin","\u002Fdocs\u002Fcore\u002Fplugin","docs\u002F2.core\u002F01.plugin",{"title":46,"path":47,"stem":48},"Game events","\u002Fdocs\u002Fcore\u002Fhooks","docs\u002F2.core\u002F02.hooks",{"title":50,"path":51,"stem":52},"Forwards","\u002Fdocs\u002Fcore\u002Fforwards","docs\u002F2.core\u002F03.forwards",{"title":54,"path":55,"stem":56},"Async and promises","\u002Fdocs\u002Fcore\u002Fasync","docs\u002F2.core\u002F04.async",{"title":58,"path":59,"stem":60},"Performance","\u002Fdocs\u002Fcore\u002Fperformance","docs\u002F2.core\u002F05.performance",{"title":62,"icon":63,"path":64,"stem":65,"children":66,"page":34},"Game","i-lucide-gamepad-2","\u002Fdocs\u002Fgame","docs\u002F3.game",[67,71,75,79,83,87],{"title":68,"path":69,"stem":70},"Players and entities","\u002Fdocs\u002Fgame\u002Fentities","docs\u002F3.game\u002F01.entities",{"title":72,"path":73,"stem":74},"Players: actions","\u002Fdocs\u002Fgame\u002Fplayers","docs\u002F3.game\u002F02.players",{"title":76,"path":77,"stem":78},"Effects","\u002Fdocs\u002Fgame\u002Feffects","docs\u002F3.game\u002F03.effects",{"title":80,"path":81,"stem":82},"Flags","\u002Fdocs\u002Fgame\u002Fflags","docs\u002F3.game\u002F04.flags",{"title":84,"path":85,"stem":86},"Cvars","\u002Fdocs\u002Fgame\u002Fcvars","docs\u002F3.game\u002F05.cvars",{"title":88,"path":89,"stem":90},"Messages","\u002Fdocs\u002Fgame\u002Fmessages","docs\u002F3.game\u002F06.messages",{"title":92,"icon":93,"path":94,"stem":95,"children":96,"page":34},"Data","i-lucide-database","\u002Fdocs\u002Fdata","docs\u002F4.data",[97,101,105],{"title":98,"path":99,"stem":100},"Storage","\u002Fdocs\u002Fdata\u002Fstorage","docs\u002F4.data\u002F01.storage",{"title":102,"path":103,"stem":104},"Files","\u002Fdocs\u002Fdata\u002Ffs","docs\u002F4.data\u002F02.fs",{"title":106,"path":107,"stem":108},"HTTP","\u002Fdocs\u002Fdata\u002Fhttp","docs\u002F4.data\u002F03.http",{"title":110,"icon":111,"path":112,"stem":113,"children":114,"page":34},"Modules","i-lucide-package","\u002Fdocs\u002Fmodules","docs\u002F5.modules",[115,119],{"title":116,"path":117,"stem":118},"Shared modules","\u002Fdocs\u002Fmodules\u002Fshared-modules","docs\u002F5.modules\u002F01.shared-modules",{"title":120,"path":121,"stem":122},"Creating a module","\u002Fdocs\u002Fmodules\u002Fcreating-a-module","docs\u002F5.modules\u002F02.creating-a-module",{"title":124,"icon":125,"path":126,"stem":127,"children":128,"page":34},"Pawn","i-lucide-plug","\u002Fdocs\u002Fpawn","docs\u002F6.pawn",[129],{"title":130,"path":131,"stem":132},"Natives","\u002Fdocs\u002Fpawn\u002Fnatives","docs\u002F6.pawn\u002F01.natives",{"title":134,"path":135,"stem":136,"children":137,"icon":139},"Testing","\u002Fdocs\u002Ftesting","docs\u002F7.testing\u002F01.index",[138],{"title":134,"path":135,"stem":136},"i-lucide-flask-conical",{"id":141,"title":23,"body":142,"description":1285,"extension":1286,"meta":1287,"navigation":1288,"path":24,"seo":1289,"stem":25,"__hash__":1290},"docs_en\u002Fdocs\u002F1.getting-started\u002F04.install.md",{"type":143,"value":144,"toc":1267},"minimark",[145,163,168,270,373,377,380,433,447,454,464,477,481,532,535,541,547,553,560,568,571,642,665,669,712,731,744,750,775,779,795,801,827,855,860,874,891,912,938,942,961,990,1006,1010,1025,1031,1037,1061,1074,1090,1108,1112,1199,1203,1219,1250,1263],[146,147,148,149,153,154,157,158,162],"p",{},"A game server runs amxts plugins with two things: the ",[150,151,152],"code",{},"amxts_amxx"," module\nand the ",[150,155,156],{},"addons\u002Famxts"," folder with the plugins. This page puts them on a\nserver of your own. The other way is the ",[159,160,161],"a",{"href":28},"server in Docker",",\nwhich has all of it inside.",[164,165,167],"h2",{"id":166},"what-the-server-needs","What the server needs",[169,170,171,179,203,256],"ul",{},[172,173,174,178],"li",{},[175,176,177],"strong",{},"Counter-Strike 1.6 on HLDS, Windows or Linux."," ReHLDS is recommended.",[172,180,181,184,185,188,189,188,192,188,195,198,199,202],{},[175,182,183],{},"Metamod and AMX Mod X 1.9 or later,"," with AMX Mod X's own modules\n",[150,186,187],{},"engine",", ",[150,190,191],{},"fakemeta",[150,193,194],{},"hamsandwich",[150,196,197],{},"cstrike"," and ",[150,200,201],{},"fun",". amxts is tested\non AMX Mod X 1.10 with Metamod-R.",[172,204,205,208,209,212,213,216,217,188,220,223,224,226,227,188,229,198,231,233,234,238,239,242,243,246,247,250,251,255],{},[175,206,207],{},"ReGameDLL and ReAPI"," for every ",[159,210,211],{"href":47},"game event"," of\nReGameDLL's and ReHLDS's own as the game raises it, and the game rules'\nfields ReGameDLL adds. Without them the plugin is written the same: the\nentity properties (",[159,214,215],{"href":69},"players and entities",") and\nthe player actions (",[150,218,219],{},"give",[150,221,222],{},"respawn",", …) work through AMX Mod X's ",[150,225,201],{},",\n",[150,228,197],{},[150,230,194],{},[150,232,191],{},", and most game events are heard\nthrough them too, some with less\n(",[159,235,237],{"href":236},"\u002Fdocs\u002Fcore\u002Fhooks#a-server-without-reapi","a server without ReAPI",").\nA plugin asks with ",[150,240,241],{},"hasModule(\"reapi\")",". A project for such a server says\n",[150,244,245],{},"target: \"hlds\""," in ",[150,248,249],{},"amxts.config.ts","\n(",[159,252,254],{"href":253},"\u002Fdocs\u002Fgetting-started\u002Fcli#the-servers-includes","the server's includes","), and a listener\nfor an event nothing there hears does not build.",[172,257,258,265,266,269],{},[175,259,260,261,264],{},"For ",[150,262,263],{},".ts"," plugins compiled on the server:"," a 64-bit system - Windows\nx64, or Linux x86-64 with glibc 2.27 or newer. A 32-bit ",[150,267,268],{},"hlds_linux"," runs on\nit as it is. A server that only runs plugins built elsewhere does not need\nthis.",[271,272,273,282],"warning",{},[146,274,275,278,281],{},[175,276,277],{},"Plain HLDS",[279,280],"br",{},"\nOn Valve's own HLDS - Metamod and AMX Mod X, no ReHLDS, ReGameDLL or ReAPI;\nchecked on Linux with metamod-p - the events of ReGameDLL's and ReHLDS's\nown are heard through AMX Mod X's own modules, as a Pawn plugin hears them\nthere. What is not there:",[169,283,284,312,323,357],{},[172,285,286,287,188,290,293,294,188,297,300,301,188,304,307,308,311],{},"the events nothing there hears - the game rules' questions\n(",[150,288,289],{},"fallDamage",[150,291,292],{},"canHaveItem",", …), the player's movement\n(",[150,295,296],{},"jumpMovement",[150,298,299],{},"move",", …), the engine's own (",[150,302,303],{},"printf",[150,305,306],{},"addResource",", …),\n",[150,309,310],{},"giveDefaultItems"," and the grenades' explosions: a listener for one is\nnever called, and the server console says so once, when it is added;",[172,313,314,315,318,319,322],{},"what some of the heard ones cannot give - most come after the game has\nacted, so ",[150,316,317],{},"preventDefault()"," and a changed field do nothing there, and a\nfew lack a field: the ",[159,320,321],{"href":236},"game events","\npage lists them, and asking for it is one line in the console;",[172,324,325,326,188,329,188,332,226,335,198,338,341,342,345,346,198,349,352,353,356],{},"the game rules' fields ",[150,327,328],{},"teamBalanced",[150,330,331],{},"neededPlayers",[150,333,334],{},"skipShowMenu",[150,336,337],{},"escapeRatio",[150,339,340],{},"updateInterval",": they read ",[150,343,344],{},"0"," and write nothing, said\nonce; ",[150,347,348],{},"timeLimit",[150,350,351],{},"gameStartTime"," are counted from ",[150,354,355],{},"mp_timelimit",";",[172,358,359,360,188,363,188,366,369,370,372],{},"ReAPI's own natives (",[150,361,362],{},"get_entvar",[150,364,365],{},"get_member",[150,367,368],{},"rg_*","): a call does\nnothing and answers ",[150,371,344],{},", said once for each native.",[164,374,376],{"id":375},"the-server-kit","The server kit",[146,378,379],{},"The kit is one archive per system, with everything that goes on the server:",[381,382,383,399],"table",{},[384,385,386],"thead",{},[387,388,389,393,396],"tr",{},[390,391,392],"th",{},"system",[390,394,395],{},"archive",[390,397,398],{},"the module",[400,401,402,418],"tbody",{},[387,403,404,408,413],{},[405,406,407],"td",{},"Windows",[405,409,410],{},[150,411,412],{},"amxts-server-windows-x64.zip",[405,414,415],{},[150,416,417],{},"amxts_amxx.dll",[387,419,420,423,428],{},[405,421,422],{},"Linux",[405,424,425],{},[150,426,427],{},"amxts-server-linux-x64.tar.gz",[405,429,430],{},[150,431,432],{},"amxts_amxx_i386.so",[146,434,435,436,442,443,446],{},"Download it from the ",[159,437,441],{"href":438,"rel":439},"https:\u002F\u002Fgithub.com\u002Famxts\u002Famxts\u002Freleases",[440],"nofollow","releases",": the\none of the same version as ",[150,444,445],{},"@amxts\u002Fcore"," in your projects.",[146,448,449,450,453],{},"What is inside, laid out as it goes into the game folder (",[150,451,452],{},"cstrike\u002F","):",[455,456,461],"pre",{"className":457,"code":459,"language":460},[458],"language-text","addons\u002F\n├── amxmodx\u002F\n│   ├── modules\u002Famxts_amxx.dll          amxts_amxx_i386.so on Linux\n│   └── scripting\u002Finclude\u002Famxts.inc     for Pawn plugins: the fields plugins add to Player\n└── amxts\u002F\n    ├── plugins.ini                     the amxts plugin list: hello.ts\n    ├── plugins\u002F                        your plugins, and beside them:\n    │   ├── hello.ts                    an example plugin\n    │   ├── facade.ts, natives.ts, …    the API a plugin uses\n    │   ├── imports.d.ts                what a plugin uses without an import, for the editor\n    │   ├── tsconfig.json               for an editor opened on this folder\n    │   └── .assemblyscript\u002F            the types that tsconfig.json points at\n    ├── build\u002F                          what the server compiles .ts plugins into\n    └── tools\u002F                          the compiler: amxts-compile, wamrc, natives.txt, licenses\u002F\nREADME.txt\n","text",[150,462,459],{"__ignoreMap":463},"",[146,465,466,469,470,198,473,476],{},[150,467,468],{},"tools\u002F"," is the system's own: ",[150,471,472],{},"amxts-compile.exe",[150,474,475],{},"wamrc.exe"," on\nWindows. A Linux upload that loses the files' execute bit is fine: the module\nsets it again before it runs them.",[164,478,480],{"id":479},"installing","Installing",[482,483,484,494,529],"ol",{},[172,485,486,487,490,491,493],{},"Copy the kit's ",[150,488,489],{},"addons\u002F"," over the game folder's ",[150,492,489],{},".",[172,495,496,497,500,501,504,505,511,513,514,516,517,519,520,523,524,528],{},"Add the module to ",[150,498,499],{},"addons\u002Famxmodx\u002Fconfigs\u002Fmodules.ini",", beside ",[150,502,503],{},"reapi"," -\nor alone, on plain HLDS:",[455,506,509],{"className":507,"code":508,"language":460},[458],"reapi\namxts_amxx\n",[150,510,508],{"__ignoreMap":463},[279,512],{},"AMX Mod X finds ",[150,515,417],{}," or ",[150,518,432],{}," by that name.\n",[150,521,522],{},"plugins.ini"," needs no line: the module loads what it needs itself\n(",[159,525,527],{"href":526},"#the-host-plugin","the host plugin",").",[172,530,531],{},"Start the server, or restart it if it runs.",[146,533,534],{},"The first start compiles the example and loads it. The console shows:",[455,536,539],{"className":537,"code":538,"language":460},[458],"[amxts] compiling ...\u002Faddons\u002Famxts\u002Fplugins\u002Fhello.ts\n[amxts] compiler exited with 0\n[amxts] loaded hello.ts\n",[150,540,538],{"__ignoreMap":463},[146,542,543,546],{},[150,544,545],{},"amxts_plugins"," in the server's console lists the plugins and what each is\ndoing, and how many of the callbacks the module lends plugins - for\ncommands, timers and game events - are in use:",[455,548,551],{"className":549,"code":550,"language":460},[458],"[amxts] 1 plugin(s): 1 running, 0 unloaded, 0 refused; 2 of 512 callback slots in use\n  hello.ts  running   Hello 1.0.0  by you - An example to edit\n",[150,552,550],{"__ignoreMap":463},[146,554,555,556,559],{},"Join the server and say ",[150,557,558],{},"\u002Fhp"," in chat to see the example answer.",[164,561,563,564],{"id":562},"updating","Updating ",[565,566],"since",{"v":567},"0.2",[146,569,570],{},"A server a project deploys to is updated from the project:",[572,573,575,599,613,627],"code-group",{"sync":574},"pm",[455,576,581],{"className":577,"code":578,"filename":579,"language":580,"meta":463,"style":463},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npx amxts upgrade\n","npm","sh",[150,582,583],{"__ignoreMap":463},[584,585,588,592,596],"span",{"class":586,"line":587},"line",1,[584,589,591],{"class":590},"sBMFI","npx",[584,593,595],{"class":594},"sfazB"," amxts",[584,597,598],{"class":594}," upgrade\n",[455,600,603],{"className":577,"code":601,"filename":602,"language":580,"meta":463,"style":463},"pnpm amxts upgrade\n","pnpm",[150,604,605],{"__ignoreMap":463},[584,606,607,609,611],{"class":586,"line":587},[584,608,602],{"class":590},[584,610,595],{"class":594},[584,612,598],{"class":594},[455,614,617],{"className":577,"code":615,"filename":616,"language":580,"meta":463,"style":463},"yarn amxts upgrade\n","yarn",[150,618,619],{"__ignoreMap":463},[584,620,621,623,625],{"class":586,"line":587},[584,622,616],{"class":590},[584,624,595],{"class":594},[584,626,598],{"class":594},[455,628,631],{"className":577,"code":629,"filename":630,"language":580,"meta":463,"style":463},"bunx amxts upgrade\n","bun",[150,632,633],{"__ignoreMap":463},[584,634,635,638,640],{"class":586,"line":587},[584,636,637],{"class":590},"bunx",[584,639,595],{"class":594},[584,641,598],{"class":594},[146,643,644,645,649,650,653,654,657,658,661,662,493],{},"Along with the project's packages and code (",[159,646,648],{"href":647},"\u002Fdocs\u002Fgetting-started\u002Fcli#upgrade","upgrade","), it\nputs the module of the new release into ",[150,651,652],{},"addons\u002Famxmodx\u002Fmodules\u002F"," - and the\ncompiler into ",[150,655,656],{},"addons\u002Famxts\u002Ftools\u002F",", where the server has one - keeping each\nold file beside it with its version (",[150,659,660],{},"amxts_amxx.dll.0.1.0","). Restart the\nserver to load the new module. A server without a project takes the new\nrelease's kit, as when ",[159,663,479],{"href":664},"#installing",[164,666,668],{"id":667},"what-the-module-writes","What the module writes",[146,670,671,672,674,675,188,678,681,682,685,686,188,689,188,692,695,696,699,700,246,703,188,706,246,709,711],{},"On every start the module lays out ",[150,673,156],{},": the ",[150,676,677],{},"plugins",[150,679,680],{},"build","\nand ",[150,683,684],{},"tools"," folders, and the files it runs plugins against - the core's API\n(",[150,687,688],{},"facade.ts",[150,690,691],{},"natives.ts",[150,693,694],{},"constants.ts"," and the rest), ",[150,697,698],{},"imports.d.ts"," and\n",[150,701,702],{},"tsconfig.json",[150,704,705],{},"plugins\u002F",[150,707,708],{},"natives.txt",[150,710,468],{},". It writes these\nover every time: they belong to the module, and an edit to them is lost.",[146,713,714,715,198,718,720,721,723,724,726,727,730],{},"It writes ",[150,716,717],{},"hello.ts",[150,719,522],{}," (naming ",[150,722,717],{},") only when they\nare not there, and leaves them alone after that: they are yours. So a\nserver with only the module gets the example too - but compiling it takes\nthe kit's ",[150,725,468],{},". Without them the console says\n",[150,728,729],{},"amxts-compile is missing - a .ts plugin needs the compiler beside the module",", and the server runs plugins built elsewhere only.",[271,732,733],{},[146,734,735,738,740,741,493],{},[175,736,737],{},"One kit, one module",[279,739],{},"\nThe module and the kit's other files come from one build. Put a newer\nmodule on the server together with the rest of its kit: a compiler or an API\nfile from another build makes plugins that cannot load. A compiler of\nanother build compiles nothing, and the console names both builds:\n",[150,742,743],{},"...\u002Fplugins\u002Fhello.ts is not compiled: amxts-compile is 0.1.0+5f1c2a9e07, the module 0.2.0+1bf291c0ab - take both from the same release",[164,745,747,748],{"id":746},"the-host-plugin","The host plugin ",[565,749],{"v":567},[146,751,752,753,756,757,760,761,764,765,767,768,770,771,774],{},"The module reaches AMX Mod X - its natives, its forwards, the natives Pawn\nplugins register - through a plugin of its own, ",[150,754,755],{},"amxts_host.amxx",", which it\ncarries inside itself. On every start it writes the plugin into\n",[150,758,759],{},"addons\u002Famxmodx\u002Fplugins\u002F"," and names it in\n",[150,762,763],{},"addons\u002Famxmodx\u002Fconfigs\u002Fplugins-amxts.ini",", a list AMX Mod X reads after\n",[150,766,522],{},"; when the server stops it removes both. So the host loads after\nthe Pawn plugins of ",[150,769,522],{},", and ",[150,772,773],{},"amxx plugins"," lists it among them -\nevery amxts plugin runs inside it. Neither file is to be edited or copied\nanywhere: they belong to the module.",[164,776,778],{"id":777},"the-plugins","The plugins",[146,780,781,784,785,788,789,516,791,794],{},[150,782,783],{},"addons\u002Famxts\u002Fplugins.ini"," lists the plugins the server runs, one file of\n",[150,786,787],{},"addons\u002Famxts\u002Fplugins\u002F"," per line, in the order they load. A line that starts\nwith ",[150,790,356],{},[150,792,793],{},"#"," is left out.",[455,796,799],{"className":797,"code":798,"language":460},[458],"; One plugin per line, as a file in plugins\u002F.\n; A .ts is compiled by the server; a .aot is loaded as it is.\nmyplugin.aot\nhello.ts\n",[150,800,798],{"__ignoreMap":463},[169,802,803,816],{},[172,804,805,806,811,812,528],{},"A ",[175,807,808],{},[150,809,810],{},".aot"," is a plugin built in a project, loaded as it is. It is built\nfor the server's system: one built for Windows does not load on Linux\n(",[159,813,815],{"href":814},"\u002Fdocs\u002Fgetting-started\u002Fcli#the-servers-system","the server's system",[172,817,805,818,822,823,826],{},[175,819,820],{},[150,821,263],{}," is compiled by the server into ",[150,824,825],{},"addons\u002Famxts\u002Fbuild\u002F\u003Cname>.aot",",\nand compiled again only when the source is newer, or when the build there\nis of another amxts.",[271,828,829],{},[146,830,831,834,836,837,839,840,843,844,847,848,851,852,854],{},[175,832,833],{},"A plugin is built for one amxts",[279,835],{},"\nA ",[150,838,810],{}," carries the amxts it was built with, and the module loads only\nplugins built for its own: one from another release would call into the\nmodule in ways it does not take. Such a plugin is not loaded, the others\nare, and the console says which one to build again:\n",[150,841,842],{},"[amxts] myplugin.aot was built for amxts 0.1.0, this is 0.2.0 - build it again","\n(or ",[150,845,846],{},"was built for an older amxts","). Updating the module, build the project\nagain and deploy it (",[150,849,850],{},"npx amxts build --deploy","); a ",[150,853,263],{}," on the server is\ncompiled again by itself.",[856,857,859],"h3",{"id":858},"from-a-project","From a project",[146,861,862,863,865,866,869,870,873],{},"A project deploys to the server's ",[150,864,156],{}," folder, which ",[150,867,868],{},"AMXTS_SERVER","\nnames in the project's ",[150,871,872],{},".env",":",[455,875,877],{"className":577,"code":876,"language":580,"meta":463,"style":463},"AMXTS_SERVER=D:\u002Fhlds\u002Fcstrike\u002Faddons\u002Famxts\n",[150,878,879],{"__ignoreMap":463},[584,880,881,884,888],{"class":586,"line":587},[584,882,868],{"class":883},"sTEyZ",[584,885,887],{"class":886},"sMK4o","=",[584,889,890],{"class":594},"D:\u002Fhlds\u002Fcstrike\u002Faddons\u002Famxts\n",[146,892,893,894,897,898,516,900,903,904,907,908,911],{},"The server's own folder (",[150,895,896],{},"D:\u002Fhlds","), its ",[150,899,197],{},[150,901,902],{},"cstrike\u002Faddons"," will\ndo too: the build takes ",[150,905,906],{},"cstrike\u002Faddons\u002Famxts"," under it and names the folder\nit uses on the ",[150,909,910],{},"Server"," line of its header. A folder that is none of them\nstops the build with one line saying where it looked.",[146,913,914,916,917,919,920,922,923,925,926,929,930,933,934,528],{},[150,915,850],{}," copies the built ",[150,918,810],{}," files into\n",[150,921,787],{}," and writes ",[150,924,783],{},": the modules\nfirst, then the project's plugins, and every line the build does not know\nafter them. A plugin that exports natives also gets its include copied into\n",[150,927,928],{},"addons\u002Famxmodx\u002Fscripting\u002Finclude\u002F",", for Pawn plugins compiled on the server.\n",[150,931,932],{},"npx amxts dev"," does it on every save and reloads the server over rcon\n(",[159,935,937],{"href":936},"\u002Fdocs\u002Fgetting-started\u002Fquick-start#hot-reload","hot reload",[856,939,941],{"id":940},"written-on-the-server","Written on the server",[146,943,805,944,946,947,949,950,952,953,956,957,960],{},[150,945,263],{}," file needs no project: put it in ",[150,948,787],{},", name it in\n",[150,951,522],{},", and load it with ",[150,954,955],{},"amxts_reload"," or the next map. From then on\nevery save compiles it again and reloads it. A compile error goes to the\nserver console, and to ",[150,958,959],{},"addons\u002Famxts\u002Fbuild\u002Fcompile.log","; the plugin that\nfailed is watched too, so saving the fix is what loads it.",[146,962,963,964,968,969,188,972,188,975,978,979,982,983,986,987,989],{},"Such a plugin uses what is in its folder: the core's API without an import,\nas in a project (",[159,965,967],{"href":966},"\u002Fdocs\u002Fcore\u002Fplugin#auto-imports","auto-imports","), and with an import\n",[150,970,971],{},"@amxts\u002Fcore\u002Fnatives",[150,973,974],{},"@amxts\u002Fcore\u002Fconstants",[150,976,977],{},"@amxts\u002Fcore\u002Ffs"," and files of your own. A module package, such as\n",[150,980,981],{},"@amxts\u002Fmenu-core",", is for plugins built in a project. For an editor, open\n",[150,984,985],{},"addons\u002Famxts\u002Fplugins"," itself, not the server's root: its ",[150,988,702],{},"\nis what tells the editor the types.",[271,991,992],{},[146,993,994,997,999,1000,1002,1003,1005],{},[175,995,996],{},"Compiling holds the server",[279,998],{},"\nThe server waits while it compiles a ",[150,1001,263],{}," plugin, a second or two. At a map\nchange nobody sees it; in the middle of a round the game freezes for that\nlong. On a server people play on, deploy ",[150,1004,810],{}," files built in a project.",[856,1007,1009],{"id":1008},"reloading","Reloading",[146,1011,1012,1013,1015,1016,1018,1019,1021,1022,1024],{},"The module looks at the plugins ten times a second. A ",[150,1014,810],{}," written again\nsince it loaded, or a ",[150,1017,263],{}," saved and compiled without an error, restarts\nevery amxts plugin from disk - no map change and no command. ",[150,1020,955],{},"\ndoes the same by hand. A restart reads ",[150,1023,522],{}," again, so a plugin added\nto the list loads with the next one.",[856,1026,1028,1029],{"id":1027},"one-plugin","One plugin ",[565,1030],{"v":567},[455,1032,1035],{"className":1033,"code":1034,"language":460},[458],"amxts_unload shop       \u002F\u002F stops shop.ts\namxts_load shop         \u002F\u002F starts it again\namxts_reload shop       \u002F\u002F starts it over from disk, compiled again if its .ts changed\namxts_load arena.ts     \u002F\u002F a file of plugins\u002F the list does not name, until the map changes\n",[150,1036,1034],{"__ignoreMap":463},[146,1038,1039,1040,1042,1043,1045,1046,1048,1049,1052,1053,1056,1057,1060],{},"A plugin is named by its line in ",[150,1041,522],{},", with or without ",[150,1044,263],{}," or\n",[150,1047,810],{},". ",[150,1050,1051],{},"amxts_unload"," stops it and takes back everything it registered -\nits timers, commands, game events, menus' callbacks and message listeners -\nand the plugin stays stopped until ",[150,1054,1055],{},"amxts_load"," or the next map; a reload of\nevery plugin leaves it stopped too. ",[150,1058,1059],{},"amxts_reload \u003Cplugin>"," restarts that\nplugin alone, and the others run on.",[146,1062,1063,1064,1067,1068,1070,1071,1073],{},"A plugin whose ",[159,1065,1066],{"href":117},"shared module"," other\nplugins use holds what they made through it - a menu, a function they handed\nit. So ",[150,1069,1051],{}," refuses it while one of them runs and names them:\nunload those first. ",[150,1072,955],{}," of it restarts them after it.",[146,1075,1076,1078,1079,188,1082,1085,1086,1089],{},[150,1077,545],{}," shows each plugin as ",[150,1080,1081],{},"running",[150,1083,1084],{},"unloaded",", or ",[150,1087,1088],{},"refused"," with\nthe reason: it does not compile, it was built for another amxts or another\nsystem, its top level failed.",[271,1091,1092],{},[146,1093,1094,1097,1099,1100,1045,1104,493],{},[175,1095,1096],{},"A plugin starts over",[279,1098],{},"\nA plugin loaded again starts from its top level: what it kept in its\nvariables is gone. What has to outlive it goes into\n",[159,1101,1103],{"href":1102},"\u002Fdocs\u002Fgame\u002Fplayers#shared-player-fields","shared player fields",[159,1105,1106],{"href":99},[150,1107,98],{},[164,1109,1111],{"id":1110},"server-commands","Server commands",[381,1113,1114,1124],{},[384,1115,1116],{},[387,1117,1118,1121],{},[390,1119,1120],{},"command",[390,1122,1123],{},"what it does",[400,1125,1126,1142,1154,1163,1176,1189],{},[387,1127,1128,1132],{},[405,1129,1130],{},[150,1131,545],{},[405,1133,1134,1135,188,1137,188,1139,1141],{},"lists the plugins: file, state (",[150,1136,1081],{},[150,1138,1084],{},[150,1140,1088],{}," and why), name, version, author; and how many callback slots are in use",[387,1143,1144,1148],{},[405,1145,1146],{},[150,1147,955],{},[405,1149,1150,1151,1153],{},"reads ",[150,1152,522],{}," again and restarts every amxts plugin from disk",[387,1155,1156,1160],{},[405,1157,1158],{},[150,1159,1059],{},[405,1161,1162],{},"restarts one plugin from disk, and the plugins that use its module",[387,1164,1165,1170],{},[405,1166,1167],{},[150,1168,1169],{},"amxts_unload \u003Cplugin>",[405,1171,1172,1173,1175],{},"stops a plugin and what it registered, until ",[150,1174,1055],{}," or the next map",[387,1177,1178,1183],{},[405,1179,1180],{},[150,1181,1182],{},"amxts_load \u003Cplugin>",[405,1184,1185,1186,1188],{},"starts a stopped plugin, or one of ",[150,1187,705],{}," the list does not name",[387,1190,1191,1196],{},[405,1192,1193],{},[150,1194,1195],{},"amxts_trace",[405,1197,1198],{},"logs every call into a plugin, for finding what crashes the server; again to turn it off",[164,1200,1202],{"id":1201},"another-plugin-list","Another plugin list",[146,1204,1205,1208,1209,1211,1212,1214,1215,1218],{},[150,1206,1207],{},"+localinfo amxts_plugins \u003Cfile>"," on the server's command line gives the\nmodule another list, as a path from the game folder. Its plugins are the\nfiles in ",[150,1210,705],{}," beside that list, and a ",[150,1213,263],{}," among them is compiled into\n",[150,1216,1217],{},"build\u002F"," beside it:",[455,1220,1222],{"className":577,"code":1221,"language":580,"meta":463,"style":463},"hlds.exe -game cstrike +localinfo amxts_plugins addons\u002Famxts\u002Fmyserver\u002Fplugins.ini +map de_dust2\n",[150,1223,1224],{"__ignoreMap":463},[584,1225,1226,1229,1232,1235,1238,1241,1244,1247],{"class":586,"line":587},[584,1227,1228],{"class":590},"hlds.exe",[584,1230,1231],{"class":594}," -game",[584,1233,1234],{"class":594}," cstrike",[584,1236,1237],{"class":594}," +localinfo",[584,1239,1240],{"class":594}," amxts_plugins",[584,1242,1243],{"class":594}," addons\u002Famxts\u002Fmyserver\u002Fplugins.ini",[584,1245,1246],{"class":594}," +map",[584,1248,1249],{"class":594}," de_dust2\n",[146,1251,1252,1253,1255,1256,1258,1259,1262],{},"With a list of its own the module does not lay out ",[150,1254,156],{},": it runs\nthat list and leaves the rest of the install as it is. The\n",[159,1257,161],{"href":28}," runs a project's ",[150,1260,1261],{},"dist\u002F"," this way.",[1264,1265,1266],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}",{"title":463,"searchDepth":1268,"depth":1269,"links":1270},2,3,[1271,1272,1273,1274,1275,1276,1277,1283,1284],{"id":166,"depth":1268,"text":167},{"id":375,"depth":1268,"text":376},{"id":479,"depth":1268,"text":480},{"id":562,"depth":1268,"text":563,"since":567},{"id":667,"depth":1268,"text":668},{"id":746,"depth":1268,"text":747,"since":567},{"id":777,"depth":1268,"text":778,"children":1278},[1279,1280,1281,1282],{"id":858,"depth":1269,"text":859},{"id":940,"depth":1269,"text":941},{"id":1008,"depth":1269,"text":1009},{"id":1027,"depth":1269,"text":1028,"since":567},{"id":1110,"depth":1268,"text":1111},{"id":1201,"depth":1268,"text":1202},"A game server runs amxts plugins with two things: the amxts_amxx module\nand the addons\u002Famxts folder with the plugins. This page puts them on a\nserver of your own. The other way is the server in Docker,\nwhich has all of it inside.","md",{},true,{"title":23,"description":1285},"knMi88xpkmRrb753K2Nel7KBFcO0BkEEA3b78CdIMaw",[1292,1294],{"title":19,"path":20,"stem":21,"description":1293,"children":-1},"amxts is the command a project runs: it creates projects and modules, adds\nmodules, builds, deploys, type-checks and tests. It is the package\n@amxts\u002Fcli, which @amxts\u002Fcore depends on, so every project has it and runs\nit through its package manager:",{"title":27,"path":28,"stem":29,"description":1295,"children":-1},"ghcr.io\u002Famxts\u002Fserver is a Docker image of a Linux Counter-Strike 1.6\nserver that runs amxts: HLDS with ReHLDS, ReGameDLL, Metamod-R, AMX Mod X 1.10\nand ReAPI, the amxts module and its compiler. Your project is mounted into\nit, and the server runs your plugins with your configs and files - on\nWindows, macOS or Linux, with nothing to install but Docker.",null,1791276253348]