Jump to content

Spaxxow

Member
  • Content Count

    41
  • Joined

  • Last visited

  • Medals

Everything posted by Spaxxow

  1. I've been struggling with this for a while. How do I spawn objects to 70 meters? The mission is based on a carrier. Cars spawn on top but the aircraft spawn below it.
  2. Theirs two halves of this. The half I need help with I have no clue how it works. I imagine it's something like getpos setpos "player" call "ace_captives_setSurrendered" true this is just a guess What I want is to be able to press 0>0>0 and It activates a radio trigger and the player calling it has to be aiming directly at the person they want to surrender withing 20 meters with like a 20% chance of them actually surrendering.
  3. Following is in the activation part of the Radio Juliet Trigger named Code 99 driver vehicle player sideChat "Code 99"; which in turn shows GroupCallsign (PlayerName): Code 99 In the chat. In addition is an audio file being played which is unrelated to the problem. So what is supposed to happen is a player presses 0>0>0 and it says in the chat Code 99 and all other players will go to that units location. But as you can guess it displays in everyones' chat their own callsign. Which causes mass confusion. How do you replace Player in multiplayer so it returns the activating players name to all other machines.
  4. Thanks for your help but i still got nothing Thank you this actually made it work.
  5. _localTrigger = createTrigger ["emptyDetector", position player, false]; _localTrigger setTriggerActivation ["JULIET", "PRESENT", true]; _localTrigger setTriggerStatements ["this", "'respawn_west' setMarkerPos (getpos player)", ""]; _localTrigger = createTrigger ["emptyDetector", position player, false]; _localTrigger setTriggerActivation ["INDIA", "PRESENT", true]; _localTrigger setTriggerStatements ["this", " [player, 'Code 99' ] remoteExec ["sideChat",0]; I tried multiple variations of this and i cannot manage to get it to work. I put it in the initplayer.sqf The respawn marker mover works but i cannot get the Code 99 to work. What am I doing wrong?
  6. Thank you so much for these. I intend to use them but how do you apply the chat part too it And how is a create task module connected to the marker?
  7. An scrollwheel option will also work.
  8. Thank you for the hasty reply. I tested this alone and it appears to do the same thing so that means it is most likely to be working properly. I will test it later with some more people but other than that I believe this is resolved. Thank you for your help.
  9. I feel like this is simple but I cannot find it. I just want to know how to set a trigger to go off any time an independent unit is killed.
  10. Spaxxow

    Trigger On Enemy Death

    addMissionEventHandler ["entityKilled", { params ["_killed","_killer","_instigator"]; if ((isPlayer _instigator or _instigator in units group player) && getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side") == 2) then { "you ve just killed an independant!" remoteExec ["hint", _instigator]; } }]; addMissionEventHandler ["entityKilled", { params ["_killed","_killer","_instigator"]; if (getNumber (configFile >> "cfgVehicles" >> typeOf _instigator >> "side") == 1 && getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side") == 2) then { "you ve just killed an independant!" remoteExec ["hint", _instigator]; } }]; Neither Seemed to work
  11. Spaxxow

    Trigger On Enemy Death

    Yeah I could give that a try to. Because like I said I want them to be able to support their AI counterparts. So how would I go about doing that?
  12. Spaxxow

    Trigger On Enemy Death

    I take it back. So my secondary goal for this was to pressure my soldiers to operate with the most precision possible. They let there AI die way too much. Right now they're currently under the impression that if they lose a soldier there will be a $250000 penalty on all MCVs. So when I was testing to see if the script worked I was lining up these units from each faction and shooting them to see if it would input or deduct the funds, in which it did. But I didn't test to see if AI killing AI had that effect. It doesn't. addMissionEventHandler ["entityKilled", { params ["_killed","_killer","_instigator"]; if (isPlayer _instigator && getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side") == 2) then {private ["_credits"]; _credits = fac1 getVariable "R3F_LOG_CF_credits"; _credits = _credits + 100000; fac1 setVariable ["R3F_LOG_CF_credits", _credits, true]; private ["_credits"]; _credits = fac2 getVariable "R3F_LOG_CF_credits"; _credits = _credits + 100000; fac2 setVariable ["R3F_LOG_CF_credits", _credits, true]; private ["_credits"]; _credits = fac3 getVariable "R3F_LOG_CF_credits"; _credits = _credits + 100000; fac3 setVariable ["R3F_LOG_CF_credits", _credits, true]; } }]; addMissionEventHandler ["entityKilled", { params ["_killed","_killer","_instigator"]; if (isPlayer _instigator && getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side") == 3) then {private ["_credits"]; _credits = fac1 getVariable "R3F_LOG_CF_credits"; _credits = _credits - 500000; fac1 setVariable ["R3F_LOG_CF_credits", _credits, true]; private ["_credits"]; _credits = fac2 getVariable "R3F_LOG_CF_credits"; _credits = _credits - 500000; fac2 setVariable ["R3F_LOG_CF_credits", _credits, true]; private ["_credits"]; _credits = fac3 getVariable "R3F_LOG_CF_credits"; _credits = _credits - 500000; fac3 setVariable ["R3F_LOG_CF_credits", _credits, true]; } }]; addMissionEventHandler ["entityKilled", { params ["_killed","_killer","_instigator"]; if (isPlayer _instigator && getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side") == 1) then {private ["_credits"]; _credits = fac1 getVariable "R3F_LOG_CF_credits"; _credits = _credits - 250000; fac1 setVariable ["R3F_LOG_CF_credits", _credits, true]; private ["_credits"]; _credits = fac2 getVariable "R3F_LOG_CF_credits"; _credits = _credits - 250000; fac2 setVariable ["R3F_LOG_CF_credits", _credits, true]; private ["_credits"]; _credits = fac3 getVariable "R3F_LOG_CF_credits"; _credits = _credits - 250000; fac3 setVariable ["R3F_LOG_CF_credits", _credits, true]; } }]; This is what I have for now. I'm not gonna tell them that it doesn't actually work. I'm going to be working on it throughout the night but I'm sure it has something to do with the Part. So I'm gonna try and find something to replace isplayer. Sorry I'm not that good at this scripting thing.
  13. Spaxxow

    Trigger On Enemy Death

    All problems have been worked out. Thank you guys so much for your help. Keep doing great things. -King Mike
  14. Spaxxow

    Trigger On Enemy Death

    Fixed it. I took it out of the trigger and put it back in the init
  15. Spaxxow

    Trigger On Enemy Death

    Ok I have made progress. addMissionEventHandler ["entityKilled", { params ["_killed","_killer","_instigator"]; if (isPlayer _instigator && getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side") == 2) then {private ["_credits"]; _credits = fac1 getVariable "R3F_LOG_CF_credits"; _credits = _credits + 100000; fac1 setVariable ["R3F_LOG_CF_credits", _credits, true]; private ["_credits"]; _credits = fac2 getVariable "R3F_LOG_CF_credits"; _credits = _credits + 100000; fac2 setVariable ["R3F_LOG_CF_credits", _credits, true]; private ["_credits"]; _credits = fac3 getVariable "R3F_LOG_CF_credits"; _credits = _credits + 100000; fac3 setVariable ["R3F_LOG_CF_credits", _credits, true]; } }]; Problem now is with every kill it adds 3.2 Million Dollars lol We are out here shooting millionaires.
  16. Spaxxow

    Trigger On Enemy Death

    I'm saying the triggers are already in the game and I need either a way to fire them with this or have the line that is in that trigger activated in place of "you've killed an independent"
  17. Spaxxow

    Trigger On Enemy Death

    Right now this private ["_credits"]; _credits = fac1 getVariable "R3F_LOG_CF_credits"; _credits = _credits + 100000; fac1 setVariable ["R3F_LOG_CF_credits", _credits, true]; Is the line I have in the deactivation trigger. What I need is to connect another trigger to the line of script you guys gave me. The trigger that needs to be connected will have this line private ["_credits"]; _credits = fac1 getVariable "R3F_LOG_CF_credits"; _credits = _credits + 100000; fac1 setVariable ["R3F_LOG_CF_credits", _credits, true]; private ["_credits"]; _credits = fac2 getVariable "R3F_LOG_CF_credits"; _credits = _credits + 100000; fac2 setVariable ["R3F_LOG_CF_credits", _credits, true]; private ["_credits"]; _credits = fac3 getVariable "R3F_LOG_CF_credits"; _credits = _credits + 100000; fac3 setVariable ["R3F_LOG_CF_credits", _credits, true]; It'll be set on repeatable so everytime the enemy is downed we get $100,000 The other one that'll be connected will have the line private ["_credits"]; _credits = fac1 getVariable "R3F_LOG_CF_credits"; _credits = _credits - 100000; fac1 setVariable ["R3F_LOG_CF_credits", _credits, true]; private ["_credits"]; _credits = fac2 getVariable "R3F_LOG_CF_credits"; _credits = _credits - 100000; fac2 setVariable ["R3F_LOG_CF_credits", _credits, true]; private ["_credits"]; _credits = fac3 getVariable "R3F_LOG_CF_credits"; _credits = _credits - 100000; fac3 setVariable ["R3F_LOG_CF_credits", _credits, true]; So everytime a friendly dies it will deduct $100,000. fac1,fac2,fac3 are the Mobile Command Vehicles in which the funds are added.
  18. Spaxxow

    Trigger On Enemy Death

    So awesome it triggered. But how do I attach this to an ingame trigger. So pretty much the ingame (TRIGGER:A) is functioned to (Add $100,000 to Command Post 1) so every time one of my guys kill an enemy the command post gets money. And the other thing is how do I apply this to BLUFOR so I can deduct money every time we lose a unit? Help is much appreciated.
  19. Spaxxow

    Trigger On Enemy Death

    Sorry for the late reply I will test this out and let you guys know how it goes. And just curious...forgot where I was going with that.
  20. All I need is to make this script repeatable so when it is done "Downloading" it'll reset and you can keep downloading it again and again. I assume it has something to do with the addactions and I know lines 85-90 have something to do with the addaction "Request Funds" disappearing after download but when I take those lines out It keeps the "Request Funds" but you can no longer download the files because it says "Funds approved" T8L_var_fileSize = 100000; // Filesize ... smaller files will take shorter time to download! T8L_var_TLine01 = "Funds Denied"; // download aborted T8L_var_TLine02 = "Standby"; // download already in progress by someone else T8L_var_TLine03 = "Requesting Funds"; // download started T8L_var_TLine04 = "Funds Approved"; // download finished T8L_var_TLine05 = "Request Funds"; // line for the addaction T8L_var_TLine06 = "Connecting ..."; T8L_var_TLine07 = "Connected:"; T8L_var_DialogAbort = false; T8L_var_DialogSucce = false; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// T8L_fnc_abortActionLaptop = { if ( T8L_var_DialogSucce ) then { T8L_var_DialogAbort = false; T8L_var_DialogSucce = false; } else { cutText [ T8L_var_TLine01, "PLAIN" ]; T8L_var_DialogAbort = true; T8L_var_DialogSucce = false; }; }; T8L_fnc_addActionLaptop = { { if !( _x getVariable [ "T8L_pvar_dataDownloaded", false ] ) then { _x addAction [ T8L_var_TLine05, { call T8L_fnc_ActionLaptop; }, [], 10, false, false ]; }; } forEach _this; }; T8L_fnc_removeActionLaptop = { _laptop = _this select 0; _id = _this select 1; _laptop removeAction _id; }; T8L_fnc_ActionLaptop = { private [ "_laptop", "_caller", "_id" ]; _laptop = _this select 0; _caller = _this select 1; _id = _this select 2; if ( _laptop getVariable [ "T8L_pvar_inUse", false ] ) exitWith { cutText [ T8L_var_TLine02, "PLAIN" ]; }; if ( _laptop getVariable [ "T8L_pvar_dataDownloaded", false ] ) exitWith { cutText [ T8L_var_TLine04, "PLAIN" ]; }; cutText [ T8L_var_TLine03, "PLAIN" ]; _laptop setVariable [ "T8L_pvar_inUse", true, true ]; [ _laptop, _id ] spawn { private [ "_laptop", "_id", "_newFile", "_dlRate", "_percent" ]; _laptop = _this select 0; _id = _this select 1; _newFile = 0; T8L_var_DialogAbort = false; T8L_var_DialogSucce = false; createDialog "T8L_DataDownloadDialog"; sleep 0.5; ctrlSetText [ 8001, T8L_var_TLine06 ]; sleep 0.5; ctrlSetText [ 8001, T8L_var_TLine07 ]; ctrlSetText [ 8003, format [ "%1 $", T8L_var_FileSize ] ]; ctrlSetText [ 8004, format [ "%1 $", _newFile ] ]; while { !T8L_var_DialogAbort } do { _dlRate = 200 + random 80; _newFile = _newFile + _dlRate; if ( _newFile > T8L_var_FileSize ) then { _dlRate = 0; _newFile = T8L_var_FileSize; ctrlSetText [ 8001, T8L_var_TLine04 ]; cutText [ T8L_var_TLine04, "PLAIN" ]; T8L_var_DialogAbort = true; T8L_var_DialogSucce = true; _laptop setVariable [ "T8L_pvar_dataDownloaded", true, true ]; [ [ _laptop, _id ], "T8L_fnc_removeActionLaptop", true, true ] spawn BIS_fnc_MP; }; // percentage part by cuel! ctrlSetText [ 8002, format [ "%1 $/t", _dlRate ] ]; _percent = ( _newFile / T8L_var_FileSize ); _percent = toArray str _percent; { _percent set [_x,-1] } forEach [ 0, 1 ]; _percent = _percent - [-1]; _percent resize 2; _percent = toString _percent; ctrlSetText [ 8004, format [ "%1 $ (%2%3)", _newFile, (if ( T8L_var_DialogAbort ) then { 100 } else { _percent }), "%" ]]; sleep 0.25; }; T8L_var_DialogAbort = false; _laptop setVariable [ "T8L_pvar_inUse", false, true ]; }; }; T8L_var_INITDONE = true;
  21. And the final answer is here */ T8L_var_fileSize = 25687; // Filesize ... smaller files will take shorter time to download! T8L_var_TLine01 = "Download aborted!"; // download aborted T8L_var_TLine02 = "Download already in progress!"; // download already in progress by someone else T8L_var_TLine03 = "Download started!"; // download started T8L_var_TLine04 = "Download complete!"; // download finished T8L_var_TLine05 = "## Download Data ##"; // line for the addaction T8L_var_TLine06 = "Connecting ..."; T8L_var_TLine07 = "Connected:"; T8L_var_DialogAbort = false; T8L_var_DialogSucce = false; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// T8L_fnc_abortActionLaptop = { if ( T8L_var_DialogSucce ) then { T8L_var_DialogAbort = false; T8L_var_DialogSucce = false; } else { cutText [ T8L_var_TLine01, "PLAIN" ]; T8L_var_DialogAbort = true; T8L_var_DialogSucce = false; }; }; T8L_fnc_addActionLaptop = { { if !( _x getVariable [ "T8L_pvar_dataDownloaded", false ] ) then { _x addAction [ T8L_var_TLine05, { call T8L_fnc_ActionLaptop; }, [], 10, false, false ]; }; } forEach _this; }; T8L_fnc_removeActionLaptop = { _laptop = _this select 0; _id = _this select 1; _laptop removeAction _id; }; T8L_fnc_ActionLaptop = { private [ "_laptop", "_caller", "_id" ]; _laptop = _this select 0; _caller = _this select 1; _id = _this select 2; if ( _laptop getVariable [ "T8L_pvar_inUse", false ] ) exitWith { cutText [ T8L_var_TLine02, "PLAIN" ]; }; if ( _laptop getVariable [ "T8L_pvar_dataDownloaded", false ] ) exitWith { cutText [ T8L_var_TLine04, "PLAIN" ]; }; cutText [ T8L_var_TLine03, "PLAIN" ]; _laptop setVariable [ "T8L_pvar_inUse", true, true ]; [ _laptop, _id ] spawn { private [ "_laptop", "_id", "_newFile", "_dlRate", "_percent" ]; _laptop = _this select 0; _id = _this select 1; _newFile = 0; T8L_var_DialogAbort = false; T8L_var_DialogSucce = false; createDialog "T8L_DataDownloadDialog"; sleep 0.5; ctrlSetText [ 8001, T8L_var_TLine06 ]; sleep 0.5; ctrlSetText [ 8001, T8L_var_TLine07 ]; ctrlSetText [ 8003, format [ "%1 kb", T8L_var_FileSize ] ]; ctrlSetText [ 8004, format [ "%1 kb", _newFile ] ]; while { !T8L_var_DialogAbort } do { _dlRate = 200 + random 80; _newFile = _newFile + _dlRate; if ( _newFile > T8L_var_FileSize ) then { _dlRate = 0; _newFile = T8L_var_FileSize; ctrlSetText [ 8001, T8L_var_TLine04 ]; cutText [ T8L_var_TLine04, "PLAIN" ]; T8L_var_DialogAbort = true; T8L_var_DialogSucce = true; _laptop setVariable [ "T8L_pvar_dataDownloaded", true, true ]; }; // percentage part by cuel! ctrlSetText [ 8002, format [ "%1 kb/t", _dlRate ] ]; _percent = ( _newFile / T8L_var_FileSize ); _percent = toArray str _percent; { _percent set [_x,-1] } forEach [ 0, 1 ]; _percent = _percent - [-1]; _percent resize 2; _percent = toString _percent; ctrlSetText [ 8004, format [ "%1 kb (%2%3)", _newFile, (if ( T8L_var_DialogAbort ) then { 100 } else { _percent }), "%" ]]; sleep 0.25; }; T8L_var_DialogAbort = false; _laptop setVariable [ "T8L_pvar_inUse", false, true ]; _laptop setVariable [ "T8L_pvar_dataDownloaded", false, true ]; }; }; T8L_var_INITDONE = true; Thank you so much for fixing this for me. All I have to do now is add my own values (easy work) thanks again HazJ.
  22. I mean you cannot test it without the mission files. Would you like those? Unless of course you can test it.
  23. Wait. Would you prefer I sent you the full file so you could use it in totality?
  24. So I tried this and now the addaction isn't even popping up */ T8L_var_fileSize = 100000; // Filesize ... smaller files will take shorter time to download! T8L_var_TLine01 = "Funds Denied"; // download aborted T8L_var_TLine02 = "Standby"; // download already in progress by someone else T8L_var_TLine03 = "Requesting Funds"; // download started T8L_var_TLine04 = "Funds Approved"; // download finished T8L_var_TLine05 = "Request Funds"; // line for the addaction T8L_var_TLine06 = "Connecting ..."; T8L_var_TLine07 = "Connected:"; T8L_var_DialogAbort = false; T8L_var_DialogSucce = false; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// T8L_fnc_abortActionLaptop = { if ( T8L_var_DialogSucce ) then { T8L_var_DialogAbort = false; T8L_var_DialogSucce = false; } else { cutText [ T8L_var_TLine01, "PLAIN" ]; T8L_var_DialogAbort = true; T8L_var_DialogSucce = false; }; }; T8L_fnc_addActionLaptop = { { if !( _x getVariable [ "T8L_pvar_dataDownloaded", false ] ) then { _x addAction [ T8L_var_TLine05, { call T8L_fnc_ActionLaptop; }, [], 10, false, false ]; }; } forEach _this; }; T8L_fnc_removeActionLaptop = { _laptop = _this select 0; _id = _this select 1; _laptop removeAction _id; }; T8L_fnc_ActionLaptop = { private [ "_laptop", "_caller", "_id" ]; _laptop = _this select 0; _caller = _this select 1; _id = _this select 2; if ( _laptop getVariable [ "T8L_pvar_inUse", false ] ) exitWith { cutText [ T8L_var_TLine02, "PLAIN" ]; }; if ( _laptop getVariable [ "T8L_pvar_dataDownloaded", false ] ) exitWith { cutText [ T8L_var_TLine04, "PLAIN" ]; }; cutText [ T8L_var_TLine03, "PLAIN" ]; _laptop setVariable [ "T8L_pvar_inUse", true, true ]; [ _laptop, _id ] spawn { private [ "_laptop", "_id", "_newFile", "_dlRate", "_percent" ]; _laptop = _this select 0; _id = _this select 1; _newFile = 0; T8L_var_DialogAbort = false; T8L_var_DialogSucce = false; createDialog "T8L_DataDownloadDialog"; sleep 0.5; ctrlSetText [ 8001, T8L_var_TLine06 ]; sleep 0.5; ctrlSetText [ 8001, T8L_var_TLine07 ]; ctrlSetText [ 8003, format [ "%1 $", T8L_var_FileSize ] ]; ctrlSetText [ 8004, format [ "%1 $", _newFile ] ]; while { !T8L_var_DialogAbort } do { _dlRate = 200 + random 80; _newFile = _newFile + _dlRate; if ( _newFile > T8L_var_FileSize ) then { _dlRate = 0; _newFile = T8L_var_FileSize; ctrlSetText [ 8001, T8L_var_TLine04 ]; cutText [ T8L_var_TLine04, "PLAIN" ]; T8L_var_DialogAbort = true; T8L_var_DialogSucce = true; _laptop setVariable [ "T8L_pvar_dataDownloaded", true, true ]; [ [ _laptop, _id ], "T8L_fnc_removeActionLaptop", true, true ] spawn BIS_fnc_MP; }; // percentage part by cuel! ctrlSetText [ 8002, format [ "%1 $/t", _dlRate ] ]; _percent = ( _newFile / T8L_var_FileSize ); _percent = toArray str _percent; { _percent set [_x,-1] } forEach [ 0, 1 ]; _percent = _percent - [-1]; _percent resize 2; _percent = toString _percent; ctrlSetText [ 8004, format [ "%1 $ (%2%3)", _newFile, (if ( T8L_var_DialogAbort ) then { 100 } else { _percent }), "%" ]]; sleep 0.25; }; T8L_var_DialogAbort = false; _laptop setVariable [ "T8L_pvar_inUse", false, true ]; _laptop setVariable [ "T8L_pvar_dataDownloaded", false, true ]; }; };
  25. So here's what I tried it didn't work so I'm gonna try removing lines 85-90 /* ======================================================================================================================= downloadData - V004 a small script to download data from a laptop ( and as example because of this complete a task ) File: downloadData.sqf Author: T-800a / cuel for percentages How to: If you want one or more objects to be used with the script, give those objects a name in the editor and add/edit the following line in the init.sqf [ [ laptop01, nameOfMyPlacedObj, ... ], "T8L_fnc_addActionLaptop", true, true] spawn BIS_fnc_MP; You can check if the download on a laptop/object was finished and you can check if someone uses this object: _laptopInUse = _myLaptop getVariable [ "T8L_pvar_inUse", false ]; _downloadComplete = _myLaptop getVariable [ "T8L_pvar_dataDownloaded", false ]; ===== LICENSE ========================================================================================================= DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar 14 rue de Plaisance, 75014 Paris, France Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO. ======================================================================================================================= */ T8L_var_fileSize = 100000; // Filesize ... smaller files will take shorter time to download! T8L_var_TLine01 = "Funds Denied"; // download aborted T8L_var_TLine02 = "Standby"; // download already in progress by someone else T8L_var_TLine03 = "Requesting Funds"; // download started T8L_var_TLine04 = "Funds Approved"; // download finished T8L_var_TLine05 = "Request Funds"; // line for the addaction T8L_var_TLine06 = "Connecting ..."; T8L_var_TLine07 = "Connected:"; T8L_var_DialogAbort = false; T8L_var_DialogSucce = false; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// T8L_fnc_abortActionLaptop = { if ( T8L_var_DialogSucce ) then { T8L_var_DialogAbort = false; T8L_var_DialogSucce = false; } else { cutText [ T8L_var_TLine01, "PLAIN" ]; T8L_var_DialogAbort = true; T8L_var_DialogSucce = false; }; }; T8L_fnc_addActionLaptop = { { if !( _x getVariable [ "T8L_pvar_dataDownloaded", false ] ) then { _x addAction [ T8L_var_TLine05, { call T8L_fnc_ActionLaptop; }, [], 10, false, false ]; }; } forEach _this; }; T8L_fnc_removeActionLaptop = { _laptop = _this select 0; _id = _this select 1; _laptop removeAction _id; }; T8L_fnc_ActionLaptop = { private [ "_laptop", "_caller", "_id" ]; _laptop = _this select 0; _caller = _this select 1; _id = _this select 2; if ( _laptop getVariable [ "T8L_pvar_inUse", false ] ) exitWith { cutText [ T8L_var_TLine02, "PLAIN" ]; }; if ( _laptop getVariable [ "T8L_pvar_dataDownloaded", false ] ) exitWith { cutText [ T8L_var_TLine04, "PLAIN" ]; }; cutText [ T8L_var_TLine03, "PLAIN" ]; _laptop setVariable [ "T8L_pvar_inUse", true, true ]; [ _laptop, _id ] spawn { private [ "_laptop", "_id", "_newFile", "_dlRate", "_percent" ]; _laptop = _this select 0; _id = _this select 1; _newFile = 0; T8L_var_DialogAbort = false; T8L_var_DialogSucce = false; createDialog "T8L_DataDownloadDialog"; sleep 0.5; ctrlSetText [ 8001, T8L_var_TLine06 ]; sleep 0.5; ctrlSetText [ 8001, T8L_var_TLine07 ]; ctrlSetText [ 8003, format [ "%1 $", T8L_var_FileSize ] ]; ctrlSetText [ 8004, format [ "%1 $", _newFile ] ]; while { !T8L_var_DialogAbort } do { _dlRate = 200 + random 80; _newFile = _newFile + _dlRate; if ( _newFile > T8L_var_FileSize ) then { _dlRate = 0; _newFile = T8L_var_FileSize; ctrlSetText [ 8001, T8L_var_TLine04 ]; cutText [ T8L_var_TLine04, "PLAIN" ]; T8L_var_DialogAbort = true; T8L_var_DialogSucce = true; _laptop setVariable [ "T8L_pvar_dataDownloaded", true, true ]; [ [ _laptop, _id ], "T8L_fnc_removeActionLaptop", true, true ] spawn BIS_fnc_MP; }; // percentage part by cuel! ctrlSetText [ 8002, format [ "%1 $/t", _dlRate ] ]; _percent = ( _newFile / T8L_var_FileSize ); _percent = toArray str _percent; { _percent set [_x,-1] } forEach [ 0, 1 ]; _percent = _percent - [-1]; _percent resize 2; _percent = toString _percent; ctrlSetText [ 8004, format [ "%1 $ (%2%3)", _newFile, (if ( T8L_var_DialogAbort ) then { 100 } else { _percent }), "%" ]]; sleep 0.25; }; T8L_var_DialogAbort = false; _laptop setVariable [ "T8L_pvar_inUse", false, true ]; }; }; T8L_var_INITDONE = true; _laptop setVariable ["T8L_pvar_inUse", false, true]; _laptop setVariable ["T8L_pvar_dataDownloaded", false, true];
×