Перейти к содержанию

OnPlayerIncomingConnection

Материал из RAGE MP Wiki Archive
Версия от 15:06, 23 декабря 2022; imported>Xabi
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

This event is triggered when an player establishes a connection with the server before loading the resources.


<syntaxhighlight lang="csharp"> [ServerEvent(Event.IncomingConnection)] </syntaxhighlight>

Parameters

  • ip: parameter input should be in string type
  • serial: parameter input should be in string type
  • rgscName: parameter input should be in string type
  • rgscId: parameter input should be in ulong type
  • gameType: parameter input should be in GameTypes type
  • cancel: parameter input should be in CancelEventArgs type

Example

<syntaxhighlight lang="csharp"> [ServerEvent(Event.IncomingConnection)] public void OnIncomingConnection(string ip, string serial, string rgscName, ulong rgscId, GameTypes gameType, CancelEventArgs cancel) { NAPI.Util.ConsoleOutput($"Connecting: {rgscName} - {ip} - {serial} - {rgscId} - {gameType}"); } </syntaxhighlight>