This event is fired after low-level game events take place, such as CEventNetworkEntityDamage
. A full list of
available game events can be found here.
string name, int args[]
This example outputs all event triggers to the console, making it easier to discover what you need:
AddEventHandler('gameEventTriggered', function (name, args)
print('game event ' .. name .. ' (' .. json.encode(args) .. ')')
end)
// In class constructor
EventHandlers["gameEventTriggered"] += new Action<string, List<dynamic>>(OnGameEventTriggered);
// Delegate method
private void OnGameEventTriggered(string name, List<dynamic> args)
{
Debug.WriteLine($"game event {name} ({String.Join(", ", args.ToArray())})");
}
on("gameEventTriggered", (name, args) => {
console.log(`Game event ${name} ${args.join(', ')}`)
});