Skip to content

Config file

iAmir edited this page Mar 21, 2021 · 4 revisions

Info

first of all, you config file should be named samp-node.json and placed in your server root directory

keys and values

Now there are two ways to configure your samp-node environment one with resources (yay!), the other without, like how it was before adding resource feature, running one single nodejs script

key type value
log_level integer log level number, 1: ERROR, 2: WARNING, 3: DEBUG, 4: INFO. the higher you set, the more logs you'll see i.e: log_level = 3, you'll see debug, warning, error logs, but not logs at info level which is 4.
enable_resources bool to enable resources feature, set to true to enable it, and false to disable
entry_file string/parth (ONLY WORKS WITH enable_resources SET TO false) path to entry file, like index.js or release/index.js
node_flags array of strings (ONLY WORKS WITH enable_resources SET TO false) list of flags you want to pass to node)
resources_path string (ONLY WORKS WITH enable_resources SET TO true) to resources folder, like samp-node, no extra characters or whatever at the beginning
resources array of strings (ONLY WORKS WITH enable_resources SET TO true) name of each resource placed in resources_pathm like anticheat, discord, or whatever

So by setting enable_resources you enable this amazing feature.

Resource config file

You need to create a file called resource-config.json and you see the structure here:

key type value
entry_file string/parth path to entry file, like index.js or release/index.js
node_flags array of strings list of flags you want to pass to node)

Config file structure

I'll just post examples:

With resources

main config file (samp-node.json):

{
    "log_level": 4,
    "enable_resources": true,
    "resources_path": "samp-node",
    "resources": [
        "anticheat",
        "discordbot",
        "discordwebhook",
        "mongodb"
    ]
}
  • NOTE: with enable_resources set to true you need to specify resources unless nothing works.

resource config file (resource-config.json)

Without resources

{
    "entry_file": "index.js",
    "node_flags": [
        "flag1",
        "flag2"
    ]
}
  • NOTE: entry_file is required, otherwise your resource will fail getting loaded
Clone this wiki locally