addNetworkHandler

From GTA Connected
Jump to: navigation, search

Function Server and Client All Games Online and Offline

Server 1.0.0, Client 1.0.0

bool addNetworkHandler(string NetworkEventName, function EventHandler)

Description

The addNetworkHandler function is used to add a handler for a custom network event that can be triggered via a server or client script.

Parameters

Documentation Missing: Parameters

Returns

Success Returns

Type Description
bool Documentation Missing: Description for success return value

Failure Returns

Documentation Missing: Failure returns

Callbacks

Server:
function(Client client, ...)
Client:

Notes

  • Use triggerNetworkEvent call a custom network event. Clients can only trigger server-side handlers, while the server can trigger a handler on either end.

Examples

Example 1 - JavaScript - Client-Side:

addNetworkHandler("walkToPos", function(civilian, x, y) {
    let walkToPos = new Vec2(x, y);
    civilian.walkTo(walkToPos);
});

Compatibility

There isn't any compatibility information for this function.

Related

Server Related

addNetworkHandler
removeNetworkHandler
triggerNetworkEvent


Client Related

addNetworkHandler
connect
disconnect
isConnected
isConnecting
removeNetworkHandler
triggerNetworkEvent