Jump to content
  • 0

Help...Deployable Laptop. Willing to donate :)


MrGrimm

Question

This script was working in my overwatch server but for some reason i cant get it to work in EPOCH and no longer in Overwatch. Im willing to donate to anyone who can get it working in both. What it does is once the laptop is placed on the ground you can then use it with MACCA134's cctv script.

	// ------------------------------------ Deploy / Pack Laptop -----------------------------------
    _weapons = [currentWeapon player] + (weapons player) + (magazines player);
    _isLaptop = typeOf cursorTarget in ["Laptop_EP1"];
 
    //Laptop DEPLOY
    if (("ItemToolbox" in _weapons) && ("ItemGPS" in _weapons)) then {
             hasLaptopItem = true;
         } else { hasLaptopItem = false;};
         if((speed player <= 1) && hasLaptopItem && _canDo) then {
         if (s_player_deployLaptop < 0) then {
             s_player_deployLaptop = player addaction[("<t color=""#007ab7"">" + ("Connect to CCTV Network") +"</t>"),"laptop\deploy.sqf","",5,false,true,"", ""];
            };
        };			
    } else {
        player removeAction s_player_deployLaptop;
        s_player_deployLaptop = -1;
    };
 
    //PACK Laptop
        if((_isLaptop) and _canDo) then {
        if (s_player_deployLaptop2 < 0) then {
            s_player_deployLaptop2 = player addaction[("<t color=""#007ab7"">" + ("Disassemble Laptop") +"</t>"),"laptop\pack.sqf","",5,false,true,"", ""];
        };
    } else {
       player removeAction s_player_deployLaptop2;
       s_player_deployLaptop2 = -1;
	};	
    //-------------------------------------------------END---------------------------------------

Any help would be greatly appreciated.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Try this, i was unable to test since I don't have the actual deploy script but if I'm not mistaken it should work.

 

_vehicle = vehicle player;


_isPZombie = player isKindOf "PZombie_VB";
_inVehicle = (_vehicle != player);
_hasToolbox = "ItemToolbox" in _itemsPlayer;
_hasGPS = "ItemGPS" in _itemsPlayer;

_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);

// ------------------------------------ Deploy / Pack Laptop -----------------------------------
_isLaptop = typeOf cursorTarget in ["Laptop_EP1"];

//Laptop DEPLOY
if ( _hasGPS && _hasToolbox ) then {
hasLaptopItem = true;
} else { hasLaptopItem = false;};
if((speed player <= 1) && hasLaptopItem && _canDo) then {
if (s_player_deployLaptop < 0) then {
s_player_deployLaptop = player addaction[("
" + ("Connect to CCTV Network") +""),"laptop\deploy.sqf","",5,false,true,"", "];
};
};
} else {
player removeAction s_player_deployLaptop;
s_player_deployLaptop = -1;
};

//PACK Laptop
if((_isLaptop) and _canDo) then {
if (s_player_deployLaptop2 < 0) then {
s_player_deployLaptop2 = player addaction[("
" + ("Disassemble Laptop") +""),"laptop\pack.sqf","",5,false,true,"", "];
};
} else {
player removeAction s_player_deployLaptop2;
s_player_deployLaptop2 = -1;
};
//-------------------------------------------------END---------------------------------------

Link to comment
Share on other sites

  • 0

Thanks for the reply....trying it now.

 

 

No option on scroll :(

 

 

Here is all the code im using.

// ------------------------------------ Deploy / Pack Laptop -----------------------------------
_isLaptop = typeOf cursorTarget in ["Laptop_EP1"];

//Laptop DEPLOY
if ( _hasGPS && _hasToolbox ) then {
hasLaptopItem = true;
} else { hasLaptopItem = false;};
if((speed player <= 1) && hasLaptopItem && _canDo) then {
if (s_player_deployLaptop < 0) then {
s_player_deployLaptop = player addaction[("" + ("Connect to CCTV Network") +""),"laptop\deploy.sqf","",5,false,true,"", ""];
};
};
} else {
player removeAction s_player_deployLaptop;
s_player_deployLaptop = -1;
};

//PACK Laptop
if((_isLaptop) and _canDo) then {
if (s_player_deployLaptop2 < 0) then {
s_player_deployLaptop2 = player addaction[("" + ("Disassemble Laptop") +""),"laptop\pack.sqf","",5,false,true,"", ""];
};
} else {
player removeAction s_player_deployLaptop2;
s_player_deployLaptop2 = -1;
};
//-------------------------------------------------END---------------------------------------

Deploy.sqf

if (false) then {
    cutText [format["You are in combat and cannot build a Laptop."], "PLAIN DOWN"];
} else {
    player removeAction s_player_deployLaptop;
    player playActionNow "Medic";
    r_interrupt = false;
    player removeWeapon "ItemToolbox";
	player removeWeapon "ItemGPS";
    _dis=10;
    _sfx = "repair";
    [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
    [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
 
    sleep 6;
 
    _object = "Laptop_EP1" createVehicle (position player);
    _object setVariable ["ObjectID", "1", true];
    _object setVariable ["ObjectUID", "1", true];
 
    player reveal _object;
 
    cutText [format["You've used your toolbox to build a Laptop!"], "PLAIN DOWN"];
 
    r_interrupt = false;
    player switchMove "";
    player playActionNow "stop";
 
    sleep 5;
 
    cutText [format[""], "PLAIN DOWN"];
 
};

Pack.sqf

if (false) then {
    cutText [format["You are in combat and cannot re-pack your Laptop."], "PLAIN DOWN"];
} else {
    player removeAction s_player_deployLaptop2;
    player playActionNow "Medic";
    r_interrupt = false;
    player addWeapon "ItemToolbox";
	player addWeapon "ItemGPS";
    deletevehicle cursortarget;
    _dis=10;
    _sfx = "repair";
    [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
    [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
   
    sleep 6;
   
    cutText [format["You have re-packed your Laptop and been given back your toolbox"], "PLAIN DOWN"];
   
    r_interrupt = false;
    player switchMove "";
    player playActionNow "stop";
};
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...