Used to stop listening to built-in events when a player joins, leaves, enters a vehicle, dies, etc. or custom events.

See the server event list for additional examples.

Declaration string, listener: (...args: any[]) => void): void

Usage'someEventName', someCallbackFunction);

Real World Example

This example shows that an event will automatically turn itself off after the first call.

function someCallbackFunction() {'someEventName', someCallbackFunction);

alt.on('someEventName', someCallbackFunction);

These examples assume you have imported alt from alt-server.

results matching ""

    No results matching ""