Jump to content
  • 0

Show when player connects?


fireplace

Question

Is there anyway of showing when a players joins the game? You get a message when a player battlelogs, which is in server_onPlayerDisconnect.sqf.

		// Message whole server when player combat logs
		_message = format["PLAYER COMBAT LOGGED: %1",_playerName];
		[nil, nil, rTitleText, _message, "PLAIN"] call RE;

Would it be possible to have like

 

_message = format["PLAYER %1",_playerName joined the game];

 

Whenever someone loads in, even from lobby? I'm not even sure when to start looking tbh :-/

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

This doesn't seem impossible. There are probably a few ways to do this. You could use the server_playerLogin file to set a variable and publicly broadcast it to all players and then use a public variable event handler to write the information in chat. OR use something like this http://epochmod.com/forum/index.php?/topic/1026-server-side-hintglobalchat-fix-deathmsg-fix/ to directly send a message to all players when a player logs in.

Link to comment
Share on other sites

  • 0

This should work fine. Add it to your server functions 

server_onPlayerConnect = {
	private ["_playerUID","_playerName"];
	_playerUID = _this select 0;
	_playerName = _this select 1;

	_message = format["PLAYER CONNECTED: %1",_playerName];
	[nil, nil, rTitleText, _message, "PLAIN"] call RE;	
};

onPlayerConnected			{[_uid,_name] call server_onPlayerConnect;};
Link to comment
Share on other sites

  • 0

 

This should work fine. Add it to your server functions 

server_onPlayerConnect = {
	private ["_playerUID","_playerName"];
	_playerUID = _this select 0;
	_playerName = _this select 1;

	_message = format["PLAYER CONNECTED: %1",_playerName];
	[nil, nil, rTitleText, _message, "PLAIN"] call RE;	
};

onPlayerConnected			{[_uid,_name] call server_onPlayerConnect;};

 

Didn't seem to work, on first connecting I got "PLAYER CONNECTED _ _Server_ _". I tried logging off back to desktop and logging back on and no message came up at all. Was cool seeing player connected come up when I first logged on through!

Link to comment
Share on other sites

  • 0

 

If you remove the system channel from being disabled then it will show in there.

 

to do this, edit your description.ext file and remove channel 6 from the disabled channels

disableChannels[]={0,2,6};

 

This is probably the quickest/easiest way.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...