DCS hook onPlayerConnect

From DCS World Wiki - Hoggitworld.com
Revision as of 00:09, 15 May 2021 by Grimes (talk | contribs) (Created page with "{{Template:DCS_hooks_callbacks |fName= onPlayerConnect |vNum= 2.5.0 |par1= hook |par2= |par3= |par4= |desc= Occurs when a player connects to a se...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Envrioment: Server
Function: onPlayerConnect Added with: 2.5.0
Member Of: hook
Syntax: nothing hook.onPlayerConnect(number id )
Description: Occurs when a player connects to a server. Passed id value is a simple unique identifier that is used with network functions to get other information about that player or actions like kicking them from the server.


Return Value: nothing
Return Actions:
Examples: Adds client info to a table named clients.
  clients = {}
  function myCall.onPlayerConnect(id)
     clients[id] = {id = id, addr = net.get_player_info(id, 'ipaddr'), name = net.get_player_info(id, 'name'), ucid = net.get_player_info(id, 'ucid'), ip = net.get_player_info(id, 'ipaddr')}
  end
Related Functions: List of Callbacks: onMissionLoadBegin, onMissionLoadProgress, onMissionLoadEnd, onSimulationStart, onSimulationStop, onSimulationFrame, onSimulationPause, onSimulationResume, onGameEvent, onNetConnect, onNetMissionChanged, onNetConnect, onNetDisconnect, onPlayerConnect, onPlayerDisconnect, onPlayerStart, onPlayerStop, onPlayerChangeSlot, onPlayerTryConnect, onPlayerTrySendChat, onPlayerTryChangeSlot
Notes: