alt.offServer

Used to stop listening to built-in events from the server. Meaning that this turns off a function where a server triggers a client-side event.

Declaration

alt.offServer(eventName: string, listener: (...args: any[]) => void): void

Usage

alt.offServer('someEvent', someCallbackFunction);

Real World Example

function someCallbackFunction(player, someArg) {
    alt.offServer('someEvent', someCallbackFunction);
}

alt.onServer('someEvent', someCallbackFunction);

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

results matching ""

    No results matching ""