OnCustomDataReceived

From GT-MP
Jump to: navigation, search
OnCustomDataReceived
Client-Side Function
System-users.png Client-Side Javascript.png JavaScript

Called when the client receives custom data transfered via downloadData by the server.

Syntax

API.onCustomDataReceived.connect(function callback);

Required Arguments

  • callback: parameter input should be in function type.

Usage example(s)

API.onCustomDataReceived.connect(function(data, id) { //id is last so it doesn't break compatibility
    API.sendChatMessage("Data ID: " + id);
    API.sendChatMessage("Data: \"" + data + "\"");
});

References