Osiedle 10 Posted December 25, 2015 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
Osiedle 10 Posted December 25, 2015 It should work like:someone clicks "abort" and goes to side choosing lobbyServer sends message "Player *someone* went to lobby" Share this post Link to post Share on other sites
Guest Posted December 25, 2015 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
killzone_kid 1331 Posted December 25, 2015 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 Posted December 25, 2015 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
Osiedle 10 Posted December 25, 2015 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
Osiedle 10 Posted December 25, 2015 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
killzone_kid 1331 Posted December 25, 2015 (edited) 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 December 25, 2015 by killzone_kid Share this post Link to post Share on other sites
Osiedle 10 Posted December 25, 2015 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 1331 Posted December 25, 2015 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
Osiedle 10 Posted December 25, 2015 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
killzone_kid 1331 Posted December 25, 2015 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
Osiedle 10 Posted December 25, 2015 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
Osiedle 10 Posted December 25, 2015 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 Posted December 25, 2015 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 Posted December 25, 2015 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
Osiedle 10 Posted December 25, 2015 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 Posted December 25, 2015 onPlayerDisconnected according to KK. But yeah it should do the trick. Share this post Link to post Share on other sites