onPlayerConnected – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:


----
----
 
Put this in init.sqf:<br>
Sy, put this in init.sqf:<br>
onPlayerConnected "[_id, _name] execVM ""PlayerConnected.sqf""";<br>
onPlayerConnected "[_id, _name] execVM ""PlayerConnected.sqf""";<br>
and fill PlayerConnected.sqf with stuff u want done when a player has connected.
and fill PlayerConnected.sqf with stuff u want done when a player has connected.
Line 23: Line 22:
onPlayerConnected could be much more handy if the player unit was supplied as a parameter, do anyone know if there are more variables than _id and _name ?<br>
onPlayerConnected could be much more handy if the player unit was supplied as a parameter, do anyone know if there are more variables than _id and _name ?<br>
--[[User:Cleanrock|Cleanrock]] 10:08, 24 June 2007 (CEST)
--[[User:Cleanrock|Cleanrock]] 10:08, 24 June 2007 (CEST)
----

Revision as of 19:22, 24 June 2007

_ID ? is this the players globalID or the game slot number ? _name? is this the players profile name from the client or the name of the players slot.

When abouts does this actually execute ? When the player connects and before they pick a player slot, or when they assume a player in the game ?

BarmyArmy

ID is broken for players on a dedicated server (id is a very high number e.g. 3.03242E+008).
On a dedicated server this function is also called with [2, "__SERVER__"] at startup (double underscores).
--Cleanrock 18:33, 21 June 2007 (CEST)

Could we compile somewhere what is sent to the JIP client when they connect?? And what is not sent to them? For example: objects and their positions are sent (whether alive or dead). What is surprisingly not sent: any weather or time change since mission start. Any objstatus update. Any marker placed by someone in game. Is flagowner sent?? Is the state of destroyed trees and buildings sent?? Maybe this should go in http://community.bistudio.com/wiki/Multiplayer_scripting? I just know that as a scripter I would be looking at onPlayerConnected for a way to solve these issues. --Doolittle 19:00, 21 June 2007 (CEST)


I'd be happy with someone providing a working example of the use of the command. --Sy 08:07, 22 June 2007 (CEST)


Put this in init.sqf:
onPlayerConnected "[_id, _name] execVM ""PlayerConnected.sqf""";
and fill PlayerConnected.sqf with stuff u want done when a player has connected.

onPlayerConnected could be much more handy if the player unit was supplied as a parameter, do anyone know if there are more variables than _id and _name ?
--Cleanrock 10:08, 24 June 2007 (CEST)