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.

JCMPNamespace

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.

JCMP Namespace class for CEF. The global instance is jcmp.

Properties

This class does not have any properties.

Functions

jcmp.AddEvent(string name, function handler)

Listens on a event called from client packages or other UIs

returns: undefined

Parameter

Name Type Description
name string event name
handler function event handler

Example

jcmp.AddEvent('MyTestEvent', function(x) {
  console.log(`MyTestEvent: x is ${x}`); // prints a message to the CEF console
});

jcmp.CallEvent(string name, any ...args)

Calls another UI event or client package event

returns: undefined

Parameter

Name Type Description
name string event name
...args any optional event arguments

Example

jcmp.CallEvent('MyTestEvent', x);

jcmp.CallLocalEvent(string name, any ...args)

Calls the given event on a client package that registered an event using WebUIWindow#AddEvent

returns: undefined

Parameter

Name Type Description
name string event name
...args any optional event arguments

Example

jcmp.CallLocalEvent('MyTestEvent', x);

jcmp.ShowCursor()

Shows the Cursor (refcounted)

Example

jcmp.ShowCursor();

jcmp.HideCursor()

hides the Cursor (refcounted)

Example

jcmp.HideCursor();

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.