triggerNetworkEvent

From GTA Connected
Jump to: navigation, search

Function Server and Client All Games Online and Offline

Server 1.0.0, Client 1.0.0

Server:
void triggerNetworkEvent(string networkEventName, null or Client client, [ ... ])
Client:
void triggerNetworkEvent(string networkEventName, [ ... ])

Description

The triggerNetworkEvent function is used to trigger a custom network event.

Parameters

Type Name Presence Default Value Description
string networkEventName required n/a The name of the network event, case-insensitive.
Client client required n/a Can be null. The client to trigger then network event for.
vararg ... optional n/a Arguments to send to the scripting functions that are bound to the network event.

Returns

Success Returns

Type Description
void This function doesn't return any values on success.

Failure Returns

Type Value
void n/a

Callbacks

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

Notes

  • When used in a server script, use null to send the event to all clients or specify a client object. See addNetworkHandler for information regarding custom event handler functions.
  • .

Examples

Example 1 - JavaScript - Server-Side:

function makeCivilianWalkToPos(civilian, x, y, z) {
    triggerNetworkEvent("walkToPos", null, civilian, x, y);
}

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