Jump to content

HomeMade Bomb


juandayz

Recommended Posts

  • 1 month later...
On 8/24/2016 at 9:32 AM, WagnerMello said:

someone found the permission in infistar not to be kicked?

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

4 hours ago, Joshyy said:

Hey Donnovan,

I like the idea of the sticky bomb with a defuse option, how would i be able to make it so you can only attach to doors/garage? and how would i make it so there is like a 1/3 chance of it breaking the door with the bomb?

Many thanks, great script

Joshyy

Hey Magic jhonson! sory @Joshyy  if u only put the bombs at doors/garages you can use a nearest restriction of this objets to execute the script, in selfactions...

i dont know the id for doors but you can obtain it into your mysql db or in arma2oa editor 3d:

at bottom of selfactions

Spoiler

//plant bomb

 private ["_hasitems","_playerPos","_neardoor"];

_hasitems = "ItemJerryMixed" in magazines player;
_playerPos = getPosATL player;
_neardoor = count nearestObjects [_playerPos, ["DOOR ID"], 3] > 0;
 
if (_neardoor) then {
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;
    };       

 

the 1/3 change to defuse it is already in it :)

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"];
};

 

Link to comment
Share on other sites

4 hours ago, Joshyy said:

Hey Donnovan,

I like the idea of the sticky bomb with a defuse option, how would i be able to make it so you can only attach to doors/garage? and how would i make it so there is like a 1/3 chance of it breaking the door with the bomb?

Many thanks, great script

Joshyy

not sure where you got donnovan from lol

Link to comment
Share on other sites

@Joshyy sory you wanna explote chances...not defuse chances..

here you got:

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;

_randchance = floor(random 100);
if (_randchance <= 30) then {
call bombexp;
};

if (_randchance <= 65 && _randchance > 31) then {
 cutText ["Bad mix your bomb fail", "PLAIN DOWN"];
};

if (_randchance <= 100 && _randchance > 66) then {
cutText ["Something wrong with your bomb, it fail", "PLAIN DOWN"];

};


   
    };
/////////////////////
_nul = [objNull, player, rSAY, "bomb",50] call RE;//REMOVE ME IF U DONT WANT SOUND TIMER
_seconds = _seconds + 1;
  sleep 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...