Documentation

Want to improve the docs? Take a look at scripting-api-data!
Found a bug? jc3mp/bugs is a good place to let us know.

Server

Constructible This class can not be instantiated from your script. Do not try to use the `new` keyword on this class. Auto Destroy Instances of this class will be deleted automatically. Custom Properties You cannot add your own properties to instances of this class. They will not be saved and can cause undefined behavior.

Information about the Server

Properties

Name Type Description
args Array<Argument> read only Server Arguments (flags)
config string read only JSON-encoded string of the config.json
currentTickRate number read only server fps
clients Array<RemoteClient> read only connected clients

Functions

Server.Stop()

This function is marked as unstable and is not recommended for use in production environments. It is not guaranteed to work at all (we're sorry).

Stops the Server

Example

jcmp.server.Stop();

Server.Restart()

This function is marked as unstable and is not recommended for use in production environments. It is not guaranteed to work at all (we're sorry).

Restarts the Server

Example

jcmp.server.Restart();

Server.AddInputHandler(function handler)

Adds a handler for the server input (console input)

Parameter

Name Type Description
handler function input handler

Example

jcmp.server.AddInputHandler(text => {
  console.log(`input: ${text}`);
});

Server.UpdateClientPackage(string p1)

Parameter

Name Type Description
p1 string

Stay informed

By becoming the newest member of our growing forums, we and hundreds of other players will always keep you up to date on everything JC3:MP related.