Jump to content

HomeMade Bomb


juandayz

Recommended Posts

This is a small script to make home made bombs.

Thers a Time Delay to select, a countdown and "Bip,Bip" sound :D

 

VIDEO:

Spoiler

 

 

 

1-Path to every bombs sqfs: custom\bomb\

 

2-Create:   bombtimer.sqf: (used for all bombs).

Spoiler

/////COUNT//////////////
_countdown = true;
_maxSeconds = selectDelay;
_seconds = 0;

while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };


 
////EXIT FROM LOOP AREA////
if (_seconds >= _maxSeconds) exitWith {

    titleText [format["Your bomb explode"],"PLAIN DOWN"]; titleFadeOut 4;
    };
/////////////////////


_nul = [objNull, player, rSAY, "bomb"] call RE;
_seconds = _seconds + 1;
  sleep 1;

};

3-in descriptions.ext (into class sounds). (ONLY PASTE LINES IN BLUE! THE OTHERS LINES ARE FOR REFERENCE)

Spoiler

class RscProgressNotFreeze
{
    idc = -1;
    type = 45;
    style = 0;
    x = 0.022059;
    y = 0.911772;
    w = 0.029412;
    h = 0.039216;
    texture = "#(argb,8,8,3)color(0,0,0,0)";
};

class CfgSounds
{
    sounds[] =
    {
        Radio_Message_Sound
        
    };
    class Radio_Message_Sound
    {
        name = "Radio_Message_Sound";
        sound[] = {custom\remote\radio.ogg,0.4,1};
        titles[] = {};
    }; 

   soundsbomb[] =
    {
    bomb
    };
    class bomb
    {
    name="bomb";
    sound[]={custom\bomb\bomb.ogg,0.9,1};
    titles[] = {};
    };    

};   

4-DOWNLOAD BOMB SOUND : http://www.mediafire.com/download/7yjzis8htqfb952/bomb.ogg

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

 

 

*THERS 4 KIND OF BOMBS (Choose one , two or all of them... works togheter.) :

 

SIMPLE BOMB// SIMPLE STICKY BOMB// STICKY BOMB WITH DEFUSE OPTION// VEHICLE BOMB

 

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

SIMPLE BOMB: (WITHOUT STICKY-WITHOUT DEFUSE). Dedicated to @chi who put "like" in all my post. TNKS chi!

Spoiler

simplebomb.sqf

Spoiler

///////////////CREATE BOMB FUNCTION////////////////
bomb = {
//_bomb = ["SH_125_HE","Bo_GBU12_LGB"] call BIS_fnc_selectRandom;
_bomb = ["HelicopterExploSmall","HelicopterExploBig","Bo_GBU12_LGB"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
  _this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
  _dabomb = _this;
};
};
//////////////////////////////////////////////////

/////////////////SELECT DELAY MENU///////////////////

selectDelay=0;
// Run timer
timer =
[
    ["StickyBomb",true],
    ["Select delay", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["10 seconds", [], "", -5, [["expression", "selectDelay=10;"]], "1", "1"],
    ["15 sec", [], "", -5, [["expression", "selectDelay=15;"]], "1", "1"],
    ["25 sec", [], "", -5, [["expression", "selectDelay=25;"]], "1", "1"],
    ["30 sec", [], "", -5, [["expression", "selectDelay=30;"]], "1", "1"],
    ["60 sec", [], "", -5, [["expression", "selectDelay=60;"]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Exit", [13], "", -3, [["expression", ""]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:timer";
WaitUntil{commandingMenu == ""};
if (isNil 'timer') then {timer=false;};
_seltimer = selectDelay;
if(selectDelay != 0) then {


///////////////////////////CONFIG TARGET////////////////////////////////
player playActionNow "PutDown";
titleText ["Time for run", "PLAIN DOWN"];

player removeMagazine "ItemBandage";//remove items
player removeMagazine "ItemJerryMixed";//same as above
player removeWeapon "ItemWatch";//remove toolbelt items
_cursor_objet = nearestObject getPos cursorTarget;
_mark = "SmokeShell" createVehicle (getPos _cursor_objet);
_mark attachTo [_cursor_objet, [0,0,0]];

_position = getPosATL player;
_neartarget = count nearestObjects [_position, ["SmokeShell"], 125] > 0;
_target = nearestObject [player, "SmokeShell"];
_positionobj = getPosATL _target;
///////////////////////////////////////////////////////////////////////
[] execVM 'custom\bomb\bombtimer.sqf';
sleep _seltimer;

/////////////////////////CALL THE BOMB/////////////////////////////////
call bomb;

titleText ["Your bomb exploded", "PLAIN DOWN"];titleFadeOut 5;
};

 

 

at bottom of your custom fn_selfactions.sqf add:

Spoiler

/////////////////////////////////SIMPLE BOMB////////////////////////////////////////////////////////    
private ["_inventory","_hasitems","_hasitems2","_hastool"];
_inventory = items player;
_hastool = "ItemWatch" in _inventory;
_hasitems = "ItemBandage" in magazines player;
_hasitems2 = "ItemJerryMixed" in magazines player;
if (_hasitems && _hasitems2 && _hastool) then {

if (s_player_simplebomb < 0) then {
            s_player_simplebomb = player addaction[("<t color=""#F7D708"">" + ("HOMEMADE BOMB") +"</t>"),"custom\bomb\simplebomb.sqf"];
        };
        
    } else {
        player removeAction s_player_simplebomb;
        s_player_simplebomb = -1;
    };       

 

 

 

 

SIMPLE STICKY BOMB: (WITH OUT DEFUSE OPTION). Dedicated to @theduke he wanna broke some tanks :D

VID:

Spoiler

 

Spoiler

simplestickybomb.sqf

Spoiler

player playActionNow "PutDown";

player removeMagazine "ItemJerryMixed";//UNCOMENT ONCE YOU TEST IT AND CHANGE IF URE USING OTHER ITEM FROM FN_SELFACTIONS TO ALLOW THE STICKY BOMB OPTION

//#############################BOMB FUNCTION TO EXPLODE############################//
bombexp = {
_bomb = ["HelicopterExploSmall","HelicopterExploBig"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
_this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
_dabomb = _this;
};
};
//############################EXIT FROM HERE#################################################//

 

_cursor_objet = nearestObject getPos cursorTarget;
_mark = "SmokeShell" createVehicle (getPos _cursor_objet);
_mark attachTo [_cursor_objet, [0,0,0.5]];

 

selectDelay = 25;//CHANGE THIS VALUE FOR MORE OR LESS TIME BEFORE BOMB EXPLODE


/////COUNTDOWN AREA//////////////
_countdown = true;
_maxSeconds = selectDelay;
_seconds = 0;
while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };
////EXIT FROM LOOP AREA////
if (_seconds >= _maxSeconds) exitWith {
_positionobj = getPosATL _mark;
call bombexp;    
    };
/////////////////////
_nul = [objNull, player, rSAY, "bomb",50] call RE;//REMOVE ME IF U DONT WANT SOUND TIMER
_seconds = _seconds + 1;
  sleep 1;
};

at bottom of your custom fn_selfactions.sqf add:

Spoiler

private ["_hasitems"];

_hasitems = "ItemJerryMixed" in magazines player; //CHANGE  IF U WNT USE OTHER ITEM TO ALLOW STICKY B OPTION.IF U CHANGE ITEM ,CHANGE IN stickybomb.sqf remove section too.

if (_hasitems) then {
if (s_player_simplesticky < 0) then {
            s_player_simplesticky = player addaction[("<t color=""#F7D708"">" + ("STICKY BOMB") +"</t>"),"custom\bomb\simplestickybomb.sqf"];
        };
          
    } else {
        player removeAction s_player_simplesticky;
        s_player_simplesticky = -1;
    };          

 

 

 

STICKYBOMB WITH DEFUSE  Dedicated to @Cherdenko 

Spoiler

stickybomb_withdefuse.sqf

Spoiler

player playActionNow "PutDown";

player removeMagazine "ItemJerryMixed";//UNCOMENT ONCE YOU TEST IT AND CHANGE IF URE USING OTHER ITEM FROM FN_SELFACTIONS TO ALLOW THE STICKY BOMB OPTION

//#############################BOMB FUNCTION TO EXPLODE############################//
bombexp = {
_bomb = ["HelicopterExploSmall","HelicopterExploBig"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
_this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
_dabomb = _this;
};
};
//############################EXIT FROM HERE#################################################//

 

_cursor_objet = nearestObject getPos cursorTarget;
_mark = "SmokeShell" createVehicle (getPos _cursor_objet);
_mark attachTo [_cursor_objet, [0,0,0.5]];
_def = "Training_target_EP1" createVehicle (getPos _cursor_objet);
_def attachTo [_cursor_objet, [0,0,0.1]];

selectDelay = 25;//CHANGE THIS VALUE FOR MORE OR LESS TIME BEFORE BOMB EXPLODE


/////COUNTDOWN AREA//////////////
_countdown = true;
_maxSeconds = selectDelay;
_seconds = 0;
while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };
////EXIT FROM LOOP AREA////
if (_seconds >= _maxSeconds) exitWith {
_positionobj = getPosATL _def;
call bombexp;    
    };
/////////////////////
_nul = [objNull, player, rSAY, "bombtimer",50] call RE;//REMOVE ME IF U DONT WANT SOUND TIMER
_seconds = _seconds + 1;
  sleep 1;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////

stickybomb_defuse.sqf

Spoiler

private ["_rand","_playerPos","_nearRestr","_delobj","_objectID","_objectUID"];

_playerPos = getPosATL player;
_nearRestr = count nearestObjects [_playerPos, ["Training_target_EP1"], 15] > 0;
_delobj = nearestObject [player, "Training_target_EP1"];

_rand = floor(random 100);

if (_rand <= 30) then {

//RED WIRE IS THE GOOD WIRE
bomb = 0;
wirecut =
[
    ["",true],
    ["wirecut", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Red Wire", [], "", -5, [["expression", "bomb=1;"]], "1", "1"],
    ["Black Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Brown Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:wirecut";
WaitUntil{commandingMenu == ""};        
};


if (_rand <= 65 && _rand > 31) then {
//BLACK WIRE IS THE GOOD
bomb = 0;
wirecut =
[
    ["",true],
    ["wirecut", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Red Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Black Wire", [], "", -5, [["expression", "bomb=1;"]], "1", "1"],
    ["Brown Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:wirecut";
WaitUntil{commandingMenu == ""};
};

if (_rand <= 100 && _rand > 66) then {
//BROWN IS THE GOOD WIRE
bomb = 0;
wirecut =
[
    ["",true],
    ["wirecut", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Red Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Black Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Brown Wire", [], "", -5, [["expression", "bomb=1;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:wirecut";
WaitUntil{commandingMenu == ""};    
};

 


if(bomb != 0) then {

///////////UNCOMENT 3 LINES BELLOW IF U WANT PLAYER ACTION/////////////
//player playActionNow "Medic";
//[player,"repair",0,false,10] call dayz_zombieSpeak;
//[player,10,true,(getPosATL player)] spawn player_alertZombies;
///////////////////////////////////////////////////////////////////////

 


titleText ["BOMB WAS DEFUSED!", "PLAIN DOWN"];


_objectID = _delobj getVariable["ObjectID","0"];
_objectUID = _delobj getVariable["ObjectUID","0"];

_objectID = _delobj getVariable["ObjectID","0"];


deleteVehicle _delobj;


[_objectID,_objectUID] call server_deleteObj;

deleteVehicle _delobj;


PVDZE_obj_Delete = [_objectID,_objectUID,_delobj];


publicVariableServer "PVDZE_obj_Delete";

 

}else{
cutText ["Wrong Wire, better run now", "PLAIN DOWN"];
};

at bottom of your custom fn_selfactions.sqf add:

Spoiler

 //plant bomb

 private ["_hasitems"];

_hasitems = "ItemJerryMixed" in magazines player;

if (_hasitems) then {
if (s_player_stickywd < 0) then {
            s_player_stickywd = player addaction[("<t color=""#F7D708"">" + ("HARDBOMB") +"</t>"),"custom\bomb\stickybomb_withdefuse.sqf"];
        };
          
    } else {
        player removeAction s_player_stickywd;
        s_player_stickywd = -1;
    };           

 

//defuse bomb
private["_inventory","_hastool","_playerPos","_nearbomb"];

_playerPos = getPosATL player;
_nearbomb = count nearestObjects [_playerPos, ["Training_target_EP1"], 3] > 0;
_inventory = items player;
_hastool = "ItemToolbox" in _inventory;

 


if (_nearbomb && _hastool) then {
        if (s_player_def < 0) then {
            s_player_def = player addaction[("<t color=""#F7D708"">" + ("DEFUSE") +"</t>"),"custom\bomb\stickybomb_defuse.sqf"];
        };
    } else {
        player removeAction s_player_def;
        s_player_def = -1;
    };       

 

 

 

VEHICLE BOMB

Spoiler

vehiclebomb.sqf

Spoiler

///////////////CREATE BOMB FUNCTION////////////////
bomb = {


_bomb = ["RocketBase","Bo_Mk82"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
  _this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
  _dabomb = _this;
};
};
//////////////////////////////////////////////////
if(isNil "script_in_progress")then{
        script_in_progress = false;
};
 
if(script_in_progress)exitwith{
titleText ["You cant put another bomb in this vechicle", "PLAIN DOWN"];titleFadeOut 5;

};
/////////////////SELECT DELAY MENU///////////////////

selectDelay=0;
// Run timer
timer =
[
    ["StickyBomb",true],
    ["Select delay", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["10 seconds", [], "", -5, [["expression", "selectDelay=10;"]], "1", "1"],
    ["15 sec", [], "", -5, [["expression", "selectDelay=15;"]], "1", "1"],
    ["25 sec", [], "", -5, [["expression", "selectDelay=25;"]], "1", "1"],
    ["30 sec", [], "", -5, [["expression", "selectDelay=30;"]], "1", "1"],
    ["60 sec", [], "", -5, [["expression", "selectDelay=60;"]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Exit", [13], "", -3, [["expression", ""]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:timer";
WaitUntil{commandingMenu == ""};
if (isNil 'timer') then {timer=false;};
_seltimer = selectDelay;
if(selectDelay != 0) then {

player removeMagazine "ItemJerryMixed";

script_in_progress = true;

///////////////////////////CONFIG TARGET////////////////////////////////
player playActionNow "PutDown";
titleText ["Time for run", "PLAIN DOWN"];
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);


_mark = "RoadFlare" createVehicle getPosATL _vehicle;
_mark setPosATL (getPosATL _vehicle);
_mark attachTo [_vehicle, [0,0,0]];
_position = getPosATL player;
_neartarget = count nearestObjects [_position, ["RoadFlare"], 125] > 0;
_target = nearestObject [player, "RoadFlare"];
_positionobj = getPosATL _target;

///////////////////////////////////////////////////////////////////////
[] execVM 'custom\bomb\bombtimer.sqf';
sleep _seltimer;

/////////////////////////CALL THE BOMB/////////////////////////////////
sleep 1;
call bomb;

titleText ["Your bomb exploded", "PLAIN DOWN"];titleFadeOut 5;
};

in your custom fn_selfactions.sqf add !!ONLY LINES IN BLUE THE OTHERS ARE FOR REFERENCE

Spoiler

if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
    if (s_player_grabflare < 0) then {
        _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
        s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
        s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
    };
} else {
    player removeAction s_player_grabflare;
    player removeAction s_player_removeflare;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
};

if (_inVehicle && (driver _vehicle == player)) then {

    if (s_player_carbomb < 0) then {
        dayz_addbomb = _vehicle;
        s_player_carbomb = dayz_addbomb addaction[("<t color=""#F7D708"">" + ("VehicleBomb") +"</t>"),"custom\bomb\vehiclebomb.sqf"];  
        };
    } else {
    
        dayz_addbomb removeAction s_player_carbomb;
        s_player_carbomb = -1;
    };

 

INFISTAR USERS:

TNKS TO @theduke for it

Spoiler

In your AHconfig.sqf

Look for _cMenu

add #USER:timer to the list of menus. This is a list of menus to tell infistar to ingnore

make sure you don't have a comma at the end of the list

If that doesn't work, you can try disabling the check for menus completely, i don't recommend it, but its a fix

I have _CCM and _BCM set to false on one of my servers. This disables it completely.

 

 

Link to comment
Share on other sites

other way is put the bomb into the cars

bomb_init2.sqf

Spoiler

///////////////CREATE BOMB FUNCTION////////////////
bomb = {


_bomb = ["RocketBase","Bo_Mk82"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
  _this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
  _dabomb = _this;
};
};
//////////////////////////////////////////////////
if(isNil "script_in_progress")then{
        script_in_progress = false;
};
 
if(script_in_progress)exitwith{
titleText ["You cant put another bomb in this vechicle", "PLAIN DOWN"];titleFadeOut 5;

};
/////////////////SELECT DELAY MENU///////////////////

selectDelay=0;
// Run timer
timer =
[
    ["StickyBomb",true],
    ["Select delay", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["10 seconds", [], "", -5, [["expression", "selectDelay=10;"]], "1", "1"],
    ["15 sec", [], "", -5, [["expression", "selectDelay=15;"]], "1", "1"],
    ["25 sec", [], "", -5, [["expression", "selectDelay=25;"]], "1", "1"],
    ["30 sec", [], "", -5, [["expression", "selectDelay=30;"]], "1", "1"],
    ["60 sec", [], "", -5, [["expression", "selectDelay=60;"]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Exit", [13], "", -3, [["expression", ""]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:timer";
WaitUntil{commandingMenu == ""};
if (isNil 'timer') then {timer=false;};
_seltimer = selectDelay;
if(selectDelay != 0) then {

 

script_in_progress = true;

///////////////////////////CONFIG TARGET////////////////////////////////
player playActionNow "PutDown";
titleText ["Time for run", "PLAIN DOWN"];
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);


_mark = "RoadFlare" createVehicle getPosATL _vehicle;
_mark setPosATL (getPosATL _vehicle);
_mark attachTo [_vehicle, [0,0,0]];
_position = getPosATL player;
_neartarget = count nearestObjects [_position, ["RoadFlare"], 125] > 0;
_target = nearestObject [player, "RoadFlare"];
_positionobj = getPosATL _target;

///////////////////////////////////////////////////////////////////////
[] execVM 'custom\bomb\bombcounter.sqf';
sleep _seltimer;

/////////////////////////CALL THE BOMB/////////////////////////////////
sleep 1;
call bomb;

titleText ["Your bomb exploded", "PLAIN DOWN"];titleFadeOut 5;
};

 

bombcounter.sqf

Spoiler

/////COUNT//////////////
_countdown = true;
_maxSeconds = selectDelay;
_seconds = 0;

while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };


 
////EXIT FROM LOOP AREA////
if (_seconds >= _maxSeconds) exitWith {

    titleText [format["Your bomb explode"],"PLAIN DOWN"]; titleFadeOut 4;
    };
/////////////////////


_nul = [objNull, player, rSAY, "bomb"] call RE;
_seconds = _seconds + 1;
  sleep 1;

};

fn_SelfActions.sqf (add only lines in blue)

Spoiler

if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
    if (s_player_grabflare < 0) then {
        _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
        s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
        s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
    };
} else {
    player removeAction s_player_grabflare;
    player removeAction s_player_removeflare;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
};


if (_inVehicle && (driver _vehicle == player)) then {

    if (s_player_carbomb < 0) then {
        dayz_addbomb = _vehicle;
        s_player_carbomb = dayz_addbomb addaction[("<t color=""#F7D708"">" + ("CarBomb") +"</t>"),"custom\bomb\bomb_init2.sqf"];  
        };
    } else {
    
        dayz_addbomb removeAction s_player_carbomb;
        s_player_carbomb = -1;
    };

description.ext  into class sounds (paste just lines in blue, the others is for reference)

Spoiler

class RscProgressNotFreeze
{
    idc = -1;
    type = 45;
    style = 0;
    x = 0.022059;
    y = 0.911772;
    w = 0.029412;
    h = 0.039216;
    texture = "#(argb,8,8,3)color(0,0,0,0)";
};

class CfgSounds
{
    sounds[] =
    {
        Radio_Message_Sound
        
    };
    class Radio_Message_Sound
    {
        name = "Radio_Message_Sound";
        sound[] = {custom\remote\radio.ogg,0.4,1};
        titles[] = {};
    }; 

   soundsbomb[] =
    {
    bomb
    };
    class bomb
    {
    name="bomb";
    sound[]={custom\stickybomb\bomb.ogg,0.9,1};
    titles[] = {};
    };    

};   

 

Link to comment
Share on other sites

@theduke  this is for sticky bombs as you want :)

stickybomb.sqf   (goes into: custom\stickybomb\)

Spoiler

player playActionNow "PutDown";

//player removeMagazine "ItemJerryMixed";//UNCOMENT ONCE YOU TEST IT AND CHANGE IF URE USING OTHER ITEM FROM FN_SELFACTIONS TO ALLOW THE STICKY BOMB OPTION

//#############################BOMB FUNCTION TO EXPLODE############################//
bombexp = {
_bomb = ["HelicopterExploSmall","HelicopterExploBig"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
_this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
_dabomb = _this;
};
};
//############################EXIT FROM HERE#################################################//

 

_cursor_objet = nearestObject getPos cursorTarget;
_mark = "SmokeShell" createVehicle (getPos _cursor_objet);
_mark attachTo [_cursor_objet, [0,0,0.5]];

 

selectDelay = 25;//CHANGE THIS VALUE FOR MORE OR LESS TIME BEFORE BOMB EXPLODE


/////COUNTDOWN AREA//////////////
_countdown = true;
_maxSeconds = selectDelay;
_seconds = 0;
while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };
////EXIT FROM LOOP AREA////
if (_seconds >= _maxSeconds) exitWith {
_positionobj = getPosATL _mark;
call bombexp;    
    };
/////////////////////
_nul = [objNull, player, rSAY, "bomb",50] call RE;//REMOVE ME IF U DONT WANT SOUND TIMER
_seconds = _seconds + 1;
  sleep 1;
};

bottom of your fn_selfactions.sqf

Spoiler

private ["_hasitems"];

_hasitems = "ItemJerryMixed" in magazines player; //CHANGE  IF U WNT USE OTHER ITEM TO ALLOW STICKY B OPTION.IF U CHANGE ITEM ,CHANGE IN stickybomb.sqf remove section too.

if (_hasitems) then {
if (s_player_stickybombinit < 0) then {
            s_player_stickybombinit = player addaction[("<t color=""#F7D708"">" + ("STICKY BOMB") +"</t>"),"custom\stickybomb\stickybomb.sqf"];
        };
          
    } else {
        player removeAction s_player_stickybombinit;
        s_player_stickybombinit = -1;
    };          

into class sounds  (descriptions.ext)

Spoiler

soundsbombtimer[] =
    {
    bombtimer
    };
    class bombtimer
    {
    name="bombtimer";
    sound[]={custom\bombtimer.ogg,0.9,1};
    titles[] = {};
    };    
    soundsbombmsg[] =
    {
    bombmsg
    };
    class bombmsg
    {
    name="bombmsg";
    sound[]={custom\events\bombcrate\bomb.ogg,0.9,1};
    titles[] = {};
    };   

bomb timer sound: http://www.mediafire.com/download/7yjzis8htqfb952/bomb.ogg

 

Link to comment
Share on other sites

@Cherdenko

i was using it to other kind of bombs. With this you can Open a scroll menu and let you choose a wire to cut. (i need test it cuz must be in a second sqf. and i guess need make changes in primary sqf to give all players the option to defuse) gonna work in it.

Spoiler

private ["_rand"];

_rand = floor(random 100);
//############################################################################################################//

//####################################1st rand: if floor random is a less or equal number of 30 start a menu to cut wires ...#################///
//#############then i define Brown Wire as good bomb=1 is the good value. The others make explode the bomb#########//    
            if (_rand <= 30) then {
            bomb = 0;
wirecut =
[
    ["",true],
    ["wirecut", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Red Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Black Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Brown Wire", [], "", -5, [["expression", "bomb=1;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:wirecut";
WaitUntil{commandingMenu == ""};    
};
//############################################EXIT FROM 1st rand############################################################//
        
//####################################2nd rand same as above but here Red Wire is the good Wire#############################///
        
if (_rand <= 65 && _rand > 31) then {
            bomb = 0;
wirecut =
[
    ["",true],
    ["wirecut", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Red Wire", [], "", -5, [["expression", "bomb=1;"]], "1", "1"],
    ["Black Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Brown Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:wirecut";
WaitUntil{commandingMenu == ""};    
};
//############################################EXIT FROM 2st rand############################################################//
        

//####################################3nd rand same as above but here Black Wire is the good Wire#############################///        
if (_rand <= 100 && _rand > 66) then {
            bomb = 0;
wirecut =
[
    ["",true],
    ["wirecut", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Red Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Black Wire", [], "", -5, [["expression", "bomb=1;"]], "1", "1"],
    ["Brown Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:wirecut";
WaitUntil{commandingMenu == ""};    
};

if(bomb != 0) then {
titleText ["BOMB WAS DEFUSED!", "PLAIN DOWN"];
deleteVehicle _mark;
}else{
cutText ["Wrong Wire, better run now", "PLAIN DOWN"];
};

 

Link to comment
Share on other sites

15 minutes ago, WagnerMello said:

Hello Juan Parabens by Script tested and worked perfectly, the only problem I'm having is that it gun in the car even if I did not have the necessary items

How can I make him do checking the items inside the car too?
Thank you!

hey wagner! try replace in fn_selfactions this lines in blue:

Spoiler

if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
    if (s_player_grabflare < 0) then {
        _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
        s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
        s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
    };
} else {
    player removeAction s_player_grabflare;
    player removeAction s_player_removeflare;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
};


if (_inVehicle && (driver _vehicle == player)) then {

    if (s_player_carbomb < 0) then {
        dayz_addbomb = _vehicle;
        s_player_carbomb = dayz_addbomb addaction[("<t color=""#F7D708"">" + ("CarBomb") +"</t>"),"custom\bomb\bomb_init2.sqf"];  
        };
    } else {
    
        dayz_addbomb removeAction s_player_carbomb;
        s_player_carbomb = -1;
    };

by this lines in red:

Spoiler

if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
    if (s_player_grabflare < 0) then {
        _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
        s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
        s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
    };
} else {
    player removeAction s_player_grabflare;
    player removeAction s_player_removeflare;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
};

private ["_hasitem"];
_hasitem = "ItemJerryMixed" in magazines player; //CHANGE  IF U WNT USE OTHER ITEM TO ALLOW  B OPTION.IF U CHANGE ITEM ,CHANGE IN bomb_init.sqf remove section too.

if (_inVehicle && (driver _vehicle == player) && _hasitem) then {

    if (s_player_carbomb < 0) then {
        dayz_addbomb = _vehicle;
        s_player_carbomb = dayz_addbomb addaction[("<t color=""#F7D708"">" + ("CarBomb") +"</t>"),"custom\bomb\bomb_init2.sqf"];  
        };
    } else {
    
        dayz_addbomb removeAction s_player_carbomb;
        s_player_carbomb = -1;
    };

 

also in bomb_init2.sqf  you will need add a remove item line so  into this file add lines in red:

Spoiler

if(selectDelay != 0) then {

player removeMagazine "ItemJerryMixed";//UNCOMENT ONCE YOU TEST IT AND CHANGE IF URE USING OTHER ITEM FROM FN_SELFACTIONS TO ALLOW THE  BOMB OPTION

script_in_progress = true;

 

Link to comment
Share on other sites

@Cherdenko  here you have a bomb with defuse.

Once bomb is active, execute another option to Defuse if u have a toolbox.  Defuse option shows a cut wire menu. Now you need choose trough 3 wires to cut. (red,Black or brown) Every time the "good" wire changes cuz thers a random to select who is the good wire.

paths to drop the sqfs: custom\bombs\  (change the paths in fn_selfactions if u want).

stickybomb_withdefuse.sqf

Spoiler

player playActionNow "PutDown";

//player removeMagazine "ItemJerryMixed";//UNCOMENT ONCE YOU TEST IT AND CHANGE IF URE USING OTHER ITEM FROM FN_SELFACTIONS TO ALLOW THE STICKY BOMB OPTION

//#############################BOMB FUNCTION TO EXPLODE############################//
bombexp = {
_bomb = ["HelicopterExploSmall","HelicopterExploBig"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
_this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
_dabomb = _this;
};
};
//############################EXIT FROM HERE#################################################//

 

_cursor_objet = nearestObject getPos cursorTarget;
_mark = "SmokeShell" createVehicle (getPos _cursor_objet);
_mark attachTo [_cursor_objet, [0,0,0.5]];
_def = "Training_target_EP1" createVehicle (getPos _cursor_objet);
_def attachTo [_cursor_objet, [0,0,0.1]];

selectDelay = 25;//CHANGE THIS VALUE FOR MORE OR LESS TIME BEFORE BOMB EXPLODE


/////COUNTDOWN AREA//////////////
_countdown = true;
_maxSeconds = selectDelay;
_seconds = 0;
while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };
////EXIT FROM LOOP AREA////
if (_seconds >= _maxSeconds) exitWith {
_positionobj = getPosATL _def;
call bombexp;    
    };
/////////////////////
_nul = [objNull, player, rSAY, "bombtimer",50] call RE;//REMOVE ME IF U DONT WANT SOUND TIMER
_seconds = _seconds + 1;
  sleep 1;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////

 

stickybomb_defuse.sqf

Spoiler

private ["_rand","_playerPos","_nearRestr","_delobj","_objectID","_objectUID"];

_playerPos = getPosATL player;
_nearRestr = count nearestObjects [_playerPos, ["Training_target_EP1"], 15] > 0;
_delobj = nearestObject [player, "Training_target_EP1"];

_rand = floor(random 100);

if (_rand <= 30) then {

//RED WIRE IS THE GOOD WIRE
bomb = 0;
wirecut =
[
    ["",true],
    ["wirecut", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Red Wire", [], "", -5, [["expression", "bomb=1;"]], "1", "1"],
    ["Black Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Brown Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:wirecut";
WaitUntil{commandingMenu == ""};        
};


if (_rand <= 65 && _rand > 31) then {
//BLACK WIRE IS THE GOOD
bomb = 0;
wirecut =
[
    ["",true],
    ["wirecut", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Red Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Black Wire", [], "", -5, [["expression", "bomb=1;"]], "1", "1"],
    ["Brown Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:wirecut";
WaitUntil{commandingMenu == ""};
};

if (_rand <= 100 && _rand > 66) then {
//BROWN IS THE GOOD WIRE
bomb = 0;
wirecut =
[
    ["",true],
    ["wirecut", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Red Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Black Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Brown Wire", [], "", -5, [["expression", "bomb=1;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:wirecut";
WaitUntil{commandingMenu == ""};    
};

 


if(bomb != 0) then {

///////////UNCOMENT 3 LINES BELLOW IF U WANT PLAYER ACTION/////////////
//player playActionNow "Medic";
//[player,"repair",0,false,10] call dayz_zombieSpeak;
//[player,10,true,(getPosATL player)] spawn player_alertZombies;
///////////////////////////////////////////////////////////////////////

 


titleText ["BOMB WAS DEFUSED!", "PLAIN DOWN"];


_objectID = _delobj getVariable["ObjectID","0"];
_objectUID = _delobj getVariable["ObjectUID","0"];

_objectID = _delobj getVariable["ObjectID","0"];


deleteVehicle _delobj;


[_objectID,_objectUID] call server_deleteObj;

deleteVehicle _delobj;


PVDZE_obj_Delete = [_objectID,_objectUID,_delobj];


publicVariableServer "PVDZE_obj_Delete";

 

}else{
cutText ["Wrong Wire, better run now", "PLAIN DOWN"];
};

at bottom of selfactions

Spoiler

 //plant bomb

 private ["_hasitems"];

_hasitems = "ItemJerryMixed" in magazines player;

if (_hasitems) then {
if (s_player_stickywd < 0) then {
            s_player_stickywd = player addaction[("<t color=""#F7D708"">" + ("STICKY BOMB") +"</t>"),"custom\bombs\stickybomb_withdefuse.sqf"];
        };
          
    } else {
        player removeAction s_player_stickywd;
        s_player_stickywd = -1;
    };           

 

//defuse bomb
private["_inventory","_hastool","_playerPos","_nearbomb"];

_playerPos = getPosATL player;
_nearbomb = count nearestObjects [_playerPos, ["Training_target_EP1"], 3] > 0;
_inventory = items player;
_hastool = "ItemToolbox" in _inventory;

 


if (_nearbomb && _hastool) then {
        if (s_player_def < 0) then {
            s_player_def = player addaction[("<t color=""#F7D708"">" + ("Defuse") +"</t>"),"custom\bombs\stickybomb_defuse.sqf"];
        };
    } else {
        player removeAction s_player_def;
        s_player_def = -1;
    };       

 

Link to comment
Share on other sites

2 minutes ago, WagnerMello said:

really cool script friend I and the admin is fun but I have to eprar a solution to the infistar to release the players

Thanks!

yep very sory wagner.. you can tell me the infi restriction? so maybe others with infi can help on it. :)

Link to comment
Share on other sites

Lets clean this post a little. XD

Path to every bombs sqfs: custom\bomb\

bombtimer.sqf: (used for all bombs).

Spoiler

/////COUNT//////////////
_countdown = true;
_maxSeconds = selectDelay;
_seconds = 0;

while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };


 
////EXIT FROM LOOP AREA////
if (_seconds >= _maxSeconds) exitWith {

    titleText [format["Your bomb explode"],"PLAIN DOWN"]; titleFadeOut 4;
    };
/////////////////////


_nul = [objNull, player, rSAY, "bomb"] call RE;
_seconds = _seconds + 1;
  sleep 1;

};

in descriptions.ext (into class sounds). (ONLY PASTE LINES IN BLUE! THE OTHERS LINES ARE FOR REFERENCE)

Spoiler

class RscProgressNotFreeze
{
    idc = -1;
    type = 45;
    style = 0;
    x = 0.022059;
    y = 0.911772;
    w = 0.029412;
    h = 0.039216;
    texture = "#(argb,8,8,3)color(0,0,0,0)";
};

class CfgSounds
{
    sounds[] =
    {
        Radio_Message_Sound
        
    };
    class Radio_Message_Sound
    {
        name = "Radio_Message_Sound";
        sound[] = {custom\remote\radio.ogg,0.4,1};
        titles[] = {};
    }; 

   soundsbomb[] =
    {
    bomb
    };
    class bomb
    {
    name="bomb";
    sound[]={custom\bomb\bomb.ogg,0.9,1};
    titles[] = {};
    };    

};   

DOWNLOAD BOMB SOUND : http://www.mediafire.com/download/7yjzis8htqfb952/bomb.ogg

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

*THERS 4 KIND OF BOMBS (Choose one , two or all of them... works togheter.) :

 

SIMPLE BOMB// SIMPLE STICKY BOMB// STICKY BOMB WITH DEFUSE OPTION// VEHICLE BOMB

 

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

SIMPLE BOMB: (WITHOUT STICKY-WITHOUT DEFUSE).

Spoiler

simplebomb.sqf

Spoiler

///////////////CREATE BOMB FUNCTION////////////////
bomb = {
//_bomb = ["SH_125_HE","Bo_GBU12_LGB"] call BIS_fnc_selectRandom;
_bomb = ["HelicopterExploSmall","HelicopterExploBig","Bo_GBU12_LGB"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
  _this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
  _dabomb = _this;
};
};
//////////////////////////////////////////////////

/////////////////SELECT DELAY MENU///////////////////

selectDelay=0;
// Run timer
timer =
[
    ["StickyBomb",true],
    ["Select delay", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["10 seconds", [], "", -5, [["expression", "selectDelay=10;"]], "1", "1"],
    ["15 sec", [], "", -5, [["expression", "selectDelay=15;"]], "1", "1"],
    ["25 sec", [], "", -5, [["expression", "selectDelay=25;"]], "1", "1"],
    ["30 sec", [], "", -5, [["expression", "selectDelay=30;"]], "1", "1"],
    ["60 sec", [], "", -5, [["expression", "selectDelay=60;"]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Exit", [13], "", -3, [["expression", ""]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:timer";
WaitUntil{commandingMenu == ""};
if (isNil 'timer') then {timer=false;};
_seltimer = selectDelay;
if(selectDelay != 0) then {


///////////////////////////CONFIG TARGET////////////////////////////////
player playActionNow "PutDown";
titleText ["Time for run", "PLAIN DOWN"];

player removeMagazine "ItemBandage";//remove items
player removeMagazine "ItemJerryMixed";//same as above
player removeWeapon "ItemWatch";//remove toolbelt items
_cursor_objet = nearestObject getPos cursorTarget;
_mark = "SmokeShell" createVehicle (getPos _cursor_objet);
_mark attachTo [_cursor_objet, [0,0,0]];

_position = getPosATL player;
_neartarget = count nearestObjects [_position, ["SmokeShell"], 125] > 0;
_target = nearestObject [player, "SmokeShell"];
_positionobj = getPosATL _target;
///////////////////////////////////////////////////////////////////////
[] execVM 'custom\bomb\bombtimer.sqf';
sleep _seltimer;

/////////////////////////CALL THE BOMB/////////////////////////////////
call bomb;

titleText ["Your bomb exploded", "PLAIN DOWN"];titleFadeOut 5;
};

 

 

at bottom of your custom fn_selfactions.sqf add:

Spoiler

/////////////////////////////////SIMPLE BOMB////////////////////////////////////////////////////////    
private ["_inventory","_hasitems","_hasitems2","_hastool"];
_inventory = items player;
_hastool = "ItemWatch" in _inventory;
_hasitems = "ItemBandage" in magazines player;
_hasitems2 = "ItemJerryMixed" in magazines player;
if (_hasitems && _hasitems2 && _hastool) then {

if (s_player_simplebomb < 0) then {
            s_player_simplebomb = player addaction[("<t color=""#F7D708"">" + ("HOMEMADE BOMB") +"</t>"),"custom\bomb\simplebomb.sqf"];
        };
        
    } else {
        player removeAction s_player_simplebomb;
        s_player_simplebomb = -1;
    };       

 

SIMPLE STICKY BOMB: (WITH OUT DEFUSE OPTION).

 

Spoiler

simplestickybomb.sqf

Spoiler

player playActionNow "PutDown";

player removeMagazine "ItemJerryMixed";//UNCOMENT ONCE YOU TEST IT AND CHANGE IF URE USING OTHER ITEM FROM FN_SELFACTIONS TO ALLOW THE STICKY BOMB OPTION

//#############################BOMB FUNCTION TO EXPLODE############################//
bombexp = {
_bomb = ["HelicopterExploSmall","HelicopterExploBig"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
_this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
_dabomb = _this;
};
};
//############################EXIT FROM HERE#################################################//

 

_cursor_objet = nearestObject getPos cursorTarget;
_mark = "SmokeShell" createVehicle (getPos _cursor_objet);
_mark attachTo [_cursor_objet, [0,0,0.5]];

 

selectDelay = 25;//CHANGE THIS VALUE FOR MORE OR LESS TIME BEFORE BOMB EXPLODE


/////COUNTDOWN AREA//////////////
_countdown = true;
_maxSeconds = selectDelay;
_seconds = 0;
while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };
////EXIT FROM LOOP AREA////
if (_seconds >= _maxSeconds) exitWith {
_positionobj = getPosATL _mark;
call bombexp;    
    };
/////////////////////
_nul = [objNull, player, rSAY, "bomb",50] call RE;//REMOVE ME IF U DONT WANT SOUND TIMER
_seconds = _seconds + 1;
  sleep 1;
};

at bottom of your custom fn_selfactions.sqf add:

Spoiler

private ["_hasitems"];

_hasitems = "ItemJerryMixed" in magazines player; //CHANGE  IF U WNT USE OTHER ITEM TO ALLOW STICKY B OPTION.IF U CHANGE ITEM ,CHANGE IN stickybomb.sqf remove section too.

if (_hasitems) then {
if (s_player_simplesticky < 0) then {
            s_player_simplesticky = player addaction[("<t color=""#F7D708"">" + ("STICKY BOMB") +"</t>"),"custom\bomb\simplestickybomb.sqf"];
        };
          
    } else {
        player removeAction s_player_simplesticky;
        s_player_simplesticky = -1;
    };          

 

STICKYBOMB WITH DEFUSE

Spoiler

stickybomb_withdefuse.sqf

Spoiler

player playActionNow "PutDown";

player removeMagazine "ItemJerryMixed";//UNCOMENT ONCE YOU TEST IT AND CHANGE IF URE USING OTHER ITEM FROM FN_SELFACTIONS TO ALLOW THE STICKY BOMB OPTION

//#############################BOMB FUNCTION TO EXPLODE############################//
bombexp = {
_bomb = ["HelicopterExploSmall","HelicopterExploBig"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
_this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
_dabomb = _this;
};
};
//############################EXIT FROM HERE#################################################//

 

_cursor_objet = nearestObject getPos cursorTarget;
_mark = "SmokeShell" createVehicle (getPos _cursor_objet);
_mark attachTo [_cursor_objet, [0,0,0.5]];
_def = "Training_target_EP1" createVehicle (getPos _cursor_objet);
_def attachTo [_cursor_objet, [0,0,0.1]];

selectDelay = 25;//CHANGE THIS VALUE FOR MORE OR LESS TIME BEFORE BOMB EXPLODE


/////COUNTDOWN AREA//////////////
_countdown = true;
_maxSeconds = selectDelay;
_seconds = 0;
while {true} do {
if(_countdown) then {
    systemChat format["COUNTDOWN: %1",_maxSeconds - _seconds]; //countdown in chat
  };
////EXIT FROM LOOP AREA////
if (_seconds >= _maxSeconds) exitWith {
_positionobj = getPosATL _def;
call bombexp;    
    };
/////////////////////
_nul = [objNull, player, rSAY, "bombtimer",50] call RE;//REMOVE ME IF U DONT WANT SOUND TIMER
_seconds = _seconds + 1;
  sleep 1;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////

stickybomb_defuse.sqf

Spoiler

private ["_rand","_playerPos","_nearRestr","_delobj","_objectID","_objectUID"];

_playerPos = getPosATL player;
_nearRestr = count nearestObjects [_playerPos, ["Training_target_EP1"], 15] > 0;
_delobj = nearestObject [player, "Training_target_EP1"];

_rand = floor(random 100);

if (_rand <= 30) then {

//RED WIRE IS THE GOOD WIRE
bomb = 0;
wirecut =
[
    ["",true],
    ["wirecut", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Red Wire", [], "", -5, [["expression", "bomb=1;"]], "1", "1"],
    ["Black Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Brown Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:wirecut";
WaitUntil{commandingMenu == ""};        
};


if (_rand <= 65 && _rand > 31) then {
//BLACK WIRE IS THE GOOD
bomb = 0;
wirecut =
[
    ["",true],
    ["wirecut", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Red Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Black Wire", [], "", -5, [["expression", "bomb=1;"]], "1", "1"],
    ["Brown Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:wirecut";
WaitUntil{commandingMenu == ""};
};

if (_rand <= 100 && _rand > 66) then {
//BROWN IS THE GOOD WIRE
bomb = 0;
wirecut =
[
    ["",true],
    ["wirecut", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Red Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Black Wire", [], "", -5, [["expression", "bomb=0;"]], "1", "1"],
    ["Brown Wire", [], "", -5, [["expression", "bomb=1;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:wirecut";
WaitUntil{commandingMenu == ""};    
};

 


if(bomb != 0) then {

///////////UNCOMENT 3 LINES BELLOW IF U WANT PLAYER ACTION/////////////
//player playActionNow "Medic";
//[player,"repair",0,false,10] call dayz_zombieSpeak;
//[player,10,true,(getPosATL player)] spawn player_alertZombies;
///////////////////////////////////////////////////////////////////////

 


titleText ["BOMB WAS DEFUSED!", "PLAIN DOWN"];


_objectID = _delobj getVariable["ObjectID","0"];
_objectUID = _delobj getVariable["ObjectUID","0"];

_objectID = _delobj getVariable["ObjectID","0"];


deleteVehicle _delobj;


[_objectID,_objectUID] call server_deleteObj;

deleteVehicle _delobj;


PVDZE_obj_Delete = [_objectID,_objectUID,_delobj];


publicVariableServer "PVDZE_obj_Delete";

 

}else{
cutText ["Wrong Wire, better run now", "PLAIN DOWN"];
};

at bottom of your custom fn_selfactions.sqf add:

Spoiler

 //plant bomb

 private ["_hasitems"];

_hasitems = "ItemJerryMixed" in magazines player;

if (_hasitems) then {
if (s_player_stickywd < 0) then {
            s_player_stickywd = player addaction[("<t color=""#F7D708"">" + ("HARDBOMB") +"</t>"),"custom\bomb\stickybomb_withdefuse.sqf"];
        };
          
    } else {
        player removeAction s_player_stickywd;
        s_player_stickywd = -1;
    };           

 

//defuse bomb
private["_inventory","_hastool","_playerPos","_nearbomb"];

_playerPos = getPosATL player;
_nearbomb = count nearestObjects [_playerPos, ["Training_target_EP1"], 3] > 0;
_inventory = items player;
_hastool = "ItemToolbox" in _inventory;

 


if (_nearbomb && _hastool) then {
        if (s_player_def < 0) then {
            s_player_def = player addaction[("<t color=""#F7D708"">" + ("DEFUSE") +"</t>"),"custom\bomb\stickybomb_defuse.sqf"];
        };
    } else {
        player removeAction s_player_def;
        s_player_def = -1;
    };       

 

VEHICLE BOMB

Spoiler

vehiclebomb.sqf

Spoiler

///////////////CREATE BOMB FUNCTION////////////////
bomb = {


_bomb = ["RocketBase","Bo_Mk82"] call BIS_fnc_selectRandom;
_dabomb = objNull;
if (true) then
{
  _this = createVehicle [_bomb,_positionobj, [], 2, "CAN_COLLIDE"];
  _dabomb = _this;
};
};
//////////////////////////////////////////////////
if(isNil "script_in_progress")then{
        script_in_progress = false;
};
 
if(script_in_progress)exitwith{
titleText ["You cant put another bomb in this vechicle", "PLAIN DOWN"];titleFadeOut 5;

};
/////////////////SELECT DELAY MENU///////////////////

selectDelay=0;
// Run timer
timer =
[
    ["StickyBomb",true],
    ["Select delay", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["10 seconds", [], "", -5, [["expression", "selectDelay=10;"]], "1", "1"],
    ["15 sec", [], "", -5, [["expression", "selectDelay=15;"]], "1", "1"],
    ["25 sec", [], "", -5, [["expression", "selectDelay=25;"]], "1", "1"],
    ["30 sec", [], "", -5, [["expression", "selectDelay=30;"]], "1", "1"],
    ["60 sec", [], "", -5, [["expression", "selectDelay=60;"]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Exit", [13], "", -3, [["expression", ""]], "1", "1"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:timer";
WaitUntil{commandingMenu == ""};
if (isNil 'timer') then {timer=false;};
_seltimer = selectDelay;
if(selectDelay != 0) then {

player removeMagazine "ItemJerryMixed";

script_in_progress = true;

///////////////////////////CONFIG TARGET////////////////////////////////
player playActionNow "PutDown";
titleText ["Time for run", "PLAIN DOWN"];
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);


_mark = "RoadFlare" createVehicle getPosATL _vehicle;
_mark setPosATL (getPosATL _vehicle);
_mark attachTo [_vehicle, [0,0,0]];
_position = getPosATL player;
_neartarget = count nearestObjects [_position, ["RoadFlare"], 125] > 0;
_target = nearestObject [player, "RoadFlare"];
_positionobj = getPosATL _target;

///////////////////////////////////////////////////////////////////////
[] execVM 'custom\bomb\bombtimer.sqf';
sleep _seltimer;

/////////////////////////CALL THE BOMB/////////////////////////////////
sleep 1;
call bomb;

titleText ["Your bomb exploded", "PLAIN DOWN"];titleFadeOut 5;
};

in your custom fn_selfactions.sqf add !!ONLY LINES IN BLUE THE OTHERS ARE FOR REFERENCE

Spoiler

if (_canPickLight && !dayz_hasLight && !_isPZombie) then {
    if (s_player_grabflare < 0) then {
        _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
        s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
        s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
    };
} else {
    player removeAction s_player_grabflare;
    player removeAction s_player_removeflare;
    s_player_grabflare = -1;
    s_player_removeflare = -1;
};

if (_inVehicle && (driver _vehicle == player)) then {

    if (s_player_carbomb < 0) then {
        dayz_addbomb = _vehicle;
        s_player_carbomb = dayz_addbomb addaction[("<t color=""#F7D708"">" + ("VehicleBomb") +"</t>"),"custom\bomb\vehiclebomb.sqf"];  
        };
    } else {
    
        dayz_addbomb removeAction s_player_carbomb;
        s_player_carbomb = -1;
    };

 

 

Link to comment
Share on other sites

1 hour ago, paulcav said:

Looks awesome mate! :)

Quick question, is there any way of making a proximity bomb that's set off by AI?

 

i think yes, creating a trigger with a bomb where opfor faction active it by his presence. let me see not tested but its a begining:

proxybomb.sqf (custom\bomb\)

Spoiler

player playActionNow "PutDown";

player removeMagazine "ItemJerryMixed";
titleText ["Proximity bomb is active now", "PLAIN DOWN"];


_cursor_objet = nearestObject getPos cursorTarget;
_posprox = getPosATL _cursor_objet;

_this = createMarker ["tar0", _posprox];
_this setMarkerText "tar0";
_this setMarkerShape "ELLIPSE";
_this setMarkerType "Move";
_this setMarkerColor "ColorRedFaded25";
_this setMarkerBrush "Solid";
_marker_0 = _this;


selectDelay = 240;//CHANGE THIS VALUE FOR MORE OR LESS TIME BEFORE PROXIMITY BOMB MUST BE REMOVED IF NO EXPLODE


_this = createTrigger ["EmptyDetector", _posprox];
_this setTriggerActivation ["EAST", "PRESENT", true];
_this setTriggerTimeout [0, 0, 0, false];
_this setTriggerStatements ["this", "bomb = ""Bo_GBU12_LGB"" createVehicle getmarkerPos ""tar0""", ""];
_trigger_0 = _this;


sleep selecDelay;
deleteMarker _marker_0;
deleteVehicle _trigger_0;

bottom of selfactions.sqf

Spoiler

/////////////////////////////////SIMPLE BOMB////////////////////////////////////////////////////////    
private ["_hasitems"];

_hasitems = "ItemJerryMixed" in magazines player;
if (_hasitems ) then {

if (s_player_proxybomb < 0) then {
            s_player_porxybomb = player addaction[("<t color=""#F7D708"">" + ("PROXY BOMB") +"</t>"),"custom\bomb\proxybomb.sqf"];
        };
        
    } else {
        player removeAction s_player_proxybomb;
        s_player_proxybomb = -1;
    };       

 

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
  • Discord

×
×
  • Create New...