From 1d7cce84092fe2b8f69e43f95bd4f50ce0415061 Mon Sep 17 00:00:00 2001 From: Valmo Trindade Date: Fri, 9 May 2025 18:27:12 -0300 Subject: [PATCH] added stop tcp socket function to check gvars and sto the socket --- addons/main/functions/api/fn_stop_tcp_socket.sqf | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 addons/main/functions/api/fn_stop_tcp_socket.sqf diff --git a/addons/main/functions/api/fn_stop_tcp_socket.sqf b/addons/main/functions/api/fn_stop_tcp_socket.sqf new file mode 100644 index 0000000..e689712 --- /dev/null +++ b/addons/main/functions/api/fn_stop_tcp_socket.sqf @@ -0,0 +1,10 @@ +_armatak_tcp_socket_is_running = missionNamespace getVariable "_armatak_tcp_socket_is_running"; + +if (_armatak_tcp_socket_is_running) then { + missionNamespace setVariable ["_armatak_tcp_socket_is_running", false]; + + "armatak" callExtension ["tcp_socket:stop", []]; +} else { + _warning = format ["ARMATAK
%1", "There is no TCP Socket running to be stopped"]; + [[_warning, 1.5]] call CBA_fnc_notify; +}; \ No newline at end of file