Jump to content

Spaxxow

Member
  • Content Count

    41
  • Joined

  • Last visited

  • Medals

Posts posted by Spaxxow


  1. 13 minutes ago, nomadd said:

    @spaxxow

     

    just a quick glance but this line is missing a closing bracket and you only have one " before  [player, 'code 99']

     

    
    _localTrigger setTriggerStatements ["this", " [player, 'Code 99' ] remoteExec ["sideChat",0]; 

    not sure but maybe try

     

    Thanks for your help but i still got nothing

    6 minutes ago, Larrow said:
    
    _localTrigger setTriggerStatements ["this", "[player, 'Code 99' ] remoteExec ['sideChat',0]", "" ];

     

    Thank you this actually made it work.


  2. _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?


  3. Thank you so much for these. I intend to use them but how do you apply the chat part too it

     

    21 minutes ago, pierremgi said:

    No, radio trigger are specific. if edited, you can't grab the player who activated it (thislist isn't working);

    The only solution is to script it and make it local, on each PC (like in initPlayerLocal.sqf):

     

    _localTrigger = createTrigger ["emptyDetector", position player, false]; // false means local, position player or anywhere else for the trigger

    _localTrigger setTriggerActivation ["JULIET", "PRESENT", true]; // true means repeatable, present is useless

    _localTrigger setTriggerStatements ["this", "'respawn_west' setMarkerPos (getpos player)", ""];  // example to move an existing marker named "respawn_west" to the actual caller's position.

     

     

    And how is a create task module connected to the marker?


  4. 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.


  5. 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.


  6. 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


  7. 13 hours ago, lordfrith said:

    the if(isPlayer _instigator) line will exclude all non player kills.

     

    you could use the technique you're using to check the side of "_killed" and check also the side of "_killer" so it would count kills by side rather than player?

    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?


  8. 22 hours ago, Spaxxow said:

    All problems have been worked out. Thank you guys so much for your help. Keep doing great things.

    -King Mike

    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 

     

    23 hours ago, Spaxxow said:

    params ["_killed","_killer","_instigator"]; if (isPlayer _instigator

    Part. So I'm gonna try and find something to replace isplayer. Sorry I'm not  that good at this scripting thing.


  9. 6 minutes ago, Spaxxow said:

    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.

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

    • Like 1

  10. 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.


  11. 7 hours ago, pierremgi said:

    Trigger?? :h:  You don't need any trigger. You have an event handler, waiting for an event (a kill). You can add any condition you need in the code (like native side or inAera or distance from something, even timer...

    I'm saying the triggers are already in the game and I need either a way to fire them with this

    On ‎10‎/‎24‎/‎2017 at 8:28 PM, pierremgi said:

    addMissionEventHandler ["entityKilled", { params ["_killed","_killer","_instigator"]; if (isPlayer _instigator && getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side") == 2) then { "you ve just killed an independant!" remoteExec ["hint", _instigator]; } }];

    or have the line that is in that trigger activated in place of "you've killed an independent"


  12. 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.


  13. On ‎10‎/‎24‎/‎2017 at 8:28 PM, pierremgi said:

    addMissionEventHandler ["entityKilled", { params ["_killed","_killer","_instigator"]; if (isPlayer _instigator && getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side") == 2) then { "you ve just killed an independant!" remoteExec ["hint", _instigator]; } }];

    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.


  14. 9 minutes ago, HazJ said:

    Here you go:

    https://1drv.ms/u/s!ArYSs9w5RSIDhDm5MpKkiRRotxq7

    Read the comments I added on line 144 and 145.

    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.


  15. 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 ];	
    	};
    };

     


  16. 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];

     


  17. 8 minutes ago, HazJ said:

    Add this at the end maybe:

    
    _laptop setVariable ["T8L_pvar_inUse", false, true];

     

    Do you mean like this?

    /*
     =======================================================================================================================
    
    	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];
    

     


  18. 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;

     

×