OnServerEventTrigger

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

Called every time the Server triggers a clientside event.

Syntax

API.onServerEventTrigger.connect(function callback);

Required Arguments

  • callback: parameter input should be in function type.

Usage example(s)

API.onServerEventTrigger.connect(function (eventName, args) {
  switch (eventName) {

    case 'atmEnterRange':
      API.sendNotification('There is an ATM nearby!');
      break;
    case 'atmLeaveRange':
      API.sendNotification("You've lost track of the nearby ATM.");
      break;
  }
});

References