Difference between revisions of "onPlayerConnected"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[cC]ommand[_ ][gG]roup:[_ ][^|]+\|\{*uc:{{PAGENAME}*]\]" to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...)
Line 1: Line 1:
{{Command|Comments=
+
{{Command
  
| arma1 |Game name=
+
| arma1
  
|1.00|Game version=
+
|1.00
  
|gr1 = Multiplayer |GROUP1=
+
|gr1 = Multiplayer
  
|gr2= Event Handlers |GROUP2=
+
|gr2= Event Handlers
  
  
Line 20: Line 20:
 
* '''_idstr''': (''since Arma 3 v1.95'') [[String]] - same as <tt>_id</tt> but in string format, so could be exactly compared to [[allMapMarkers | user marker]] ids.<br><br>
 
* '''_idstr''': (''since Arma 3 v1.95'') [[String]] - same as <tt>_id</tt> but in string format, so could be exactly compared to [[allMapMarkers | user marker]] ids.<br><br>
 
{{Feature|arma3 | Since '''Arma 3''' ''v1.57'' a stackable MissionEventHandler is available and should be used: [[Arma_3:_Event_Handlers/addMissionEventHandler#PlayerConnected|PlayerConnected]].<br>
 
{{Feature|arma3 | Since '''Arma 3''' ''v1.57'' a stackable MissionEventHandler is available and should be used: [[Arma_3:_Event_Handlers/addMissionEventHandler#PlayerConnected|PlayerConnected]].<br>
Before that, the functions [[BIS_fnc_addStackedEventHandler]] and [[BIS_fnc_removeStackedEventHandler]] should be used instead in order to keep compatibility between official and community content.}}|DESCRIPTION=
+
Before that, the functions [[BIS_fnc_addStackedEventHandler]] and [[BIS_fnc_removeStackedEventHandler]] should be used instead in order to keep compatibility between official and community content.}}
  
| [[onPlayerConnected]] code |SYNTAX=
+
| [[onPlayerConnected]] code
  
|p1= code: [[String]] or [[Code]] |PARAMETER1=
+
|p1= code: [[String]] or [[Code]]
  
| [[Nothing]] |RETURNVALUE=
+
| [[Nothing]]
  
|x1= <code>[[onPlayerConnected]] "[_id, _name] [[execVM]] ""PlayerConnected.sqf""";</code> |EXAMPLE1=
+
|x1= <code>[[onPlayerConnected]] "[_id, _name] [[execVM]] ""PlayerConnected.sqf""";</code>
  
|x2= <code>[[onPlayerConnected]] { [[diag_log]] [_id, _uid, _name] };</code> |EXAMPLE2=
+
|x2= <code>[[onPlayerConnected]] { [[diag_log]] [_id, _uid, _name] };</code>
  
 
|x3= From '''{{arma3}}''' v1.49:
 
|x3= From '''{{arma3}}''' v1.49:
Line 38: Line 38:
 
{{cc|this will set somevar}}
 
{{cc|this will set somevar}}
 
{{cc|joining player PC to a random value}}
 
{{cc|joining player PC to a random value}}
};</code>|EXAMPLE3=
+
};</code>
  
 
|x4= From '''{{arma3}}''' v1.49:
 
|x4= From '''{{arma3}}''' v1.49:
 
<code>[[onPlayerConnected]] { isJip = _jip; _owner [[publicVariableClient]] "isJip" };
 
<code>[[onPlayerConnected]] { isJip = _jip; _owner [[publicVariableClient]] "isJip" };
{{cc|Each player will now have variable isJip containing individual JIP info}}</code> |EXAMPLE4=
+
{{cc|Each player will now have variable isJip containing individual JIP info}}</code>
  
 
|mp= The ''statement'' is executed only on the server, not on the joining player's computer, nor on any other client.<br>
 
|mp= The ''statement'' is executed only on the server, not on the joining player's computer, nor on any other client.<br>
Line 48: Line 48:
 
Note that there is a player with the '''_name''' called __SERVER__ which will also connect to a multiplayer game, executing ''code''. |Multiplayer=
 
Note that there is a player with the '''_name''' called __SERVER__ which will also connect to a multiplayer game, executing ''code''. |Multiplayer=
  
| [[onPlayerDisconnected]], [[didJIP]], [[didJIPOwner]]|SEEALSO=
+
| [[onPlayerDisconnected]], [[didJIP]], [[didJIPOwner]]
 
}}
 
}}
  

Revision as of 02:31, 18 January 2021

Template:Command

Bottom Section