Jump to content
Osiedle

AL "went to lobby" script - reward for help!

Recommended Posts

Hello guys!
I have my Altis Life server, and i really want to introduce one script to it. But first - what's the situation:
When people are f.e. in Kavala, and they want to go to f.e. sophia, they do something like that: they click esc, then - abort, and then, without disconnecting from server, while they are in side choose lobby, they click "ok". What's next, they're back in the game, but they can choose respawn place. The problem is that some people do that while beeing in combat. There is no message like "player xxx disconnected" because they're still on the server. What i want to do, is to make (or buy) a script, which will send a chat message like "player disconnected", but saying "player xxx went to lobby". Can someone help me with that? I'm totally new in arma scripting, but i know how to code for example in c++, so i can understand much, but i don't know how arma scripting looks and how to do that. Thanks!

Share this post


Link to post
Share on other sites

It should work like:
someone clicks "abort" and goes to side choosing lobby
Server sends message "Player *someone* went to lobby" 

Share this post


Link to post
Share on other sites
Guest

Hey,

On altis life mission there is the fn_escInterrupt where you can edit the abort button.

I bet with setButtonAction or something because i'm on my phone I don't have the wiki in mind.

Share this post


Link to post
Share on other sites

This should do it:

onPlayerDisconnected {(format ["Player %1 went to lobby", _name]) remoteExecCall ["systemChat", 0]};

Share this post


Link to post
Share on other sites
Guest

Well I looked up the wiki and I bet you can change the button abort action this way.

// Get the button current action w/ the quit to lobby code
_code = buttonAction _AbortButtonIdc;
_code = "[[(name player) + "" went to lobby""],""TON_fnc_log"",false,true] call life_fnc_MP" + _code;
buttonSetAction [_abortButtonIdc,_code];
Don't think this code is 100% accurate I did that from my phone without testing anything.

Share this post


Link to post
Share on other sites

Killzone_kid

 

 

This should do it:

onPlayerDisconnected {(format ["Player %1 went to lobby", _name]) remoteExecCall ["systemChat", 0]};

It wouldn't do, read my post again. The message "Player went to lobby" should apper when they click abort, not when they disconnect. When you click abort you are moved to side choosing, but you're not disconnected yet. Anyway, thanks for trying to help. If you have any idea - i'm waiting :)
harmdhast - i am totally new to arma scripting, so if you could later tell me step by step what should i do - i'll be glad :)

Share this post


Link to post
Share on other sites

Well I looked up the wiki and I bet you can change the button abort action this way.

// Get the button current action w/ the quit to lobby code
_code = buttonAction _AbortButtonIdc;
_code = "[[(name player) + "" went to lobby""],""TON_fnc_log"",false,true] call life_fnc_MP" + _code;
buttonSetAction [_abortButtonIdc,_code];
Don't think this code is 100% accurate I did that from my phone without testing anything.

 

Thank you so much! If you'll have a time later - you can (if you want) explain to me where to put it, or check if it works :) Thanks a lot, i'll reward you with something :)

Share this post


Link to post
Share on other sites

Actually on second thought, using "HandleDisconnect" EH is better in case onPlayerDisconnected is used already:
 

addMissionEventHandler ["HandleDisconnect", {(format ["Player %1 went to lobby", _this select 3]) remoteExecCall ["systemChat", 0]}];
Edited by killzone_kid

Share this post


Link to post
Share on other sites

 

Actually on second thought, using "HandleDisconnect" EH is better in case onPlayerDisconnected is used already:

 

addMissionEventHandler ["HandleDisconnect", {(format ["Player %1 went to lobby", _name]) remoteExecCall ["systemChat", 0]}];

Sir, again - it's not about disconnecting, it's about clicking "abort" and being in side choosing (role choosing) menu.

Share this post


Link to post
Share on other sites

Killzone_kid

 

It wouldn't do, read my post again. The message "Player went to lobby" should apper when they click abort, not when they disconnect. When you click abort you are moved to side choosing, but you're not disconnected yet. Anyway, thanks for trying to help. If you have any idea - i'm waiting :)

harmdhast - i am totally new to arma scripting, so if you could later tell me step by step what should i do - i'll be glad :)

 

When you click ABORT, onPlayerDisconnected event fires. You don't have to disconnect from server. This is how it works in Arma 3. I am not familiar with Life mode, maybe they hacked ABORT button somehow (doubt it), but it should work in normal Arma.

Share this post


Link to post
Share on other sites

Ah, ok, now i understand it! Thanks! I'll try it, but what should i do with that code?

Share this post


Link to post
Share on other sites

Sir, again - it's not about disconnecting, it's about clicking "abort" and being in side choosing (role choosing) menu.

 

I read what you said, and I also told you this works for user just clicking ABORT. You wanted detect user going to lobby, here it is. However I personally think your attitude might need a bit of improving especially when asking for help.

Share this post


Link to post
Share on other sites

Yeah, sorry sir, that forum does not refresh automatically, so i posted that not knowing that you explained it to me :)

Share this post


Link to post
Share on other sites

Nevertheless, could you also tell me what should i do with that code? I'll be really glad :)

Share this post


Link to post
Share on other sites
Guest

To use the solution of killzonekid you can setup the event handler in your setupEVH.sqf file. I think it's in missionroot/core

Just follow whats already written in there but change the EH to inPlayerDisconnect

Share this post


Link to post
Share on other sites
Guest

I will go back home in few hours. If not resolved yet I will give you the files and were to put in the KK code.

Share this post


Link to post
Share on other sites

So just pasteing addMissionEventHandler ["HandleDisconnect", {(format ["Player %1 went to lobby", _name]) remoteExecCall ["systemChat", 0]}]; into setupEVH.sqf file will do it?

Share this post


Link to post
Share on other sites
Guest

onPlayerDisconnected according to KK. But yeah it should do the trick.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×