TriggerClientEvent

From GTA Network Wiki
Jump to: navigation, search

TriggerClientEvent
Server-Side Function

utilities-terminal.png Server-Side csharp.png C#

Triggers a client-side script event call from server-side to a Player. For the inverse method of this (client to server), you will have to use mp.events.callRemote("MyEvent", 1, 2, 3);

Syntax

void NAPI.ClientEvent.TriggerClientEvent(Client player, string eventName, params object[] args);

Required Arguments

  • player: parameter input should be in Client type.
  • eventName: parameter input should be in string type.
  • args: parameter input should be in object type. See the Synchronized Types for which types of objects you can pass here.

Usage example

NAPI.ClientEvent.TriggerClientEvent(player, "MyEvent", 1, 2, 3, "DUCK");

Changelog

Version Description
1.0 Release.

References