samp.directory
← Skripte und Bibliotheken

dockfries/samp-node

Legacy sa-mp plugin to run node.js scripts.

Plugin★ 2aktualisiert vor 4 TagenKeine LizenzC++sampctlArchiviert
Auf GitHub öffnen

Der Autor hat dieses Repository archiviert, es wird also nicht mehr gepflegt.

Dieses Repository hat keine Lizenzdatei. Es ist öffentlich lesbar, aber das allein gibt noch keine Erlaubnis, es weiterzuverwenden.

Mit sampctl installieren

sampctl package install dockfries/samp-node

Führe das in deinem Projektordner aus. sampctl lädt das Paket und alles herunter, wovon es abhängt.

Im Pawn-Compiler ausprobieren →

Fügt seine Include-Dateien samt der Bibliotheken, von denen es abhängt, dem Pawn-Compiler in deinem Browser hinzu, bereit zum Einbinden in ein Skript.

README.md

samp-node

Forked from AmyrAhmady/samp-node

Changes in this fork

  • Only can work with infernus.
  • Update Node.js to v22.23.5.
  • Both ESModule and CommonJS supported, depending on the type field of package.json and the bundler output format.
  • Only entry_file is used, resource config are removed.
  • Removed samp.fire to avoid crashes.
  • Building based on ubuntu-latest means you may need a higher version of glibc.
  • Updated github workflows.

Api

check here

libnode (Node.js shared library)

This project depends on libnode — Node.js built as a shared library.

Pre-built binaries are downloaded automatically from github.com/dockfries/libnode/releases during CMake configuration.

See that repository for instructions on building libnode from source for a specific Node.js version.

Node headers

The headers used to compile against libnode live in deps/node/include, which is a shallow submodule pointing at github.com/MohammadMD1383/node-headers tagged v22.23.5 — matching the libnode binaries downloaded above. If you build a libnode for a different Node.js version, switch the submodule to the corresponding tag first:

git submodule update --init --recursive   # shallow clone of node-headers
cd deps/node/include
git fetch --depth 1 origin tag v<version>
git checkout v<version>

Local paths

If you prefer to build libnode yourself, place the files here:

ArchWindowsLinux
x86 (default)deps/node/lib/Release/win/libnode.lib + libnode.dlldeps/node/lib/Release/linux/libnode.so.127
x64deps/node/lib/Release/win64/libnode.lib + libnode.dlldeps/node/lib/Release/linux64/libnode.so.127

Set -D__deps_check_enabled=false when running cmake to skip the download.

How to build samp-node

linux with docker

git clone --recursive https://github.com/dockfries/samp-node
# or ssh
# git clone --recursive [email protected]:dockfries/samp-node.git
cd samp-node
git submodule update --init --recursive

chmod +x ./build.sh
./build.sh 22.23.5 # version

linux with cmake

cd samp-node
git submodule update --init --recursive   # ensure submodules (incl. node headers & sampgdk) are checked out
mkdir build && cd build

# for 32-bit:
cmake -DCMAKE_BUILD_TYPE=Release ..
# for 64-bit:
# cmake -DPLUGIN_ARCH=x64 -DCMAKE_BUILD_TYPE=Release ..

make -j$(nproc)

windows with Visual Studio

cd samp-node
git submodule update --init --recursive   # ensure submodules (incl. node headers & sampgdk) are checked out
mkdir build, releases -ErrorAction SilentlyContinue
cd build

# for 32-bit:
cmake .. -A Win32
# for 64-bit:
# cmake .. -A x64 -DPLUGIN_ARCH=x64

cmake --build . --config Release
cpack

cd ..
Move-Item -Path "build/cpack/*" -Destination "releases/" -Force

github actions

fork and run on github actions.

Credits

gtagtasaopenmultiplayersa-mpsa-mp-developmentsa-mp-serversamp-node

Diese Seite wird aus dem erstellt, was GitHub über das Repository veröffentlicht. samp.directory hostet den Code nicht. Ein Problem mit diesem Eintrag melden