[Release] Body Traps

Matt L

OpenDayZ Rockstar!
Body Traps
Version 1.0

What it does....
Gives you a scroll option when you are looking at something dead ( not sure if it can be placed on AI) to place an explosive. This explodes when someone comes within 5 meters (default, can change) This is a reworked version of my Booby Trap.

Requirements (inc. Tools(must include dowload link)/ Expected Time/Difficulty)
Installation Steps -
  1. If you have not already, override fn_selfActions and compiles.sqf (will go over later), in your fn_selfActions place
    Code:
    if ((speed player <= 1) && !_isAlive && _canDo and (player distance cursorTarget < 3)) then {
        if (s_player_makePLBomb < 0) then {
            s_player_makePLBomb = player addAction [("<t color=""#c30000"">" + ("Booby trap the body?") +"</t>"),"Scripts\SetBodyBomb.sqf","",5,false,true,"",""];
        };
    } else {
        player removeAction s_player_makePLBomb;
        s_player_makePLBomb = -1;
    }; /*  Create by MattL. Places a bomb on a players body */
    At the bottom. UPDATED WITH MENU FIX *Thanks Helmet*
  2. Download the 3 files and place them in a Scripts folder (Link at the bottom) and then in your init place
    Code:
    if (isServer) then {
            "DZ_bodyTrap" addPublicVariableEventHandler {[_this select 1] execVM 'Scripts\createBodyBomb.sqf'};
    };
    at the bottom
  3. change the distance you want the bombs to explode, found in createBodyBomb.sqf
    Code:
    _bombTrigger setTriggerArea [5,5,0,false];
    the 5's represent the X,Y values in meters.
FAQ -
  • Can I edit this to only be used for bandits/heros or to explode for bandits/heroes? Yes you can, refer to my original Booby Trap post for instructions how. You can also restrict use by UID instead of humanity.
  • The option won't show / doesn't work...If you are using an antihack you need to whitelist s_player_makePLBomb in the dayz_actions section
  • How can I restrict the use of this to only work on dead players, or dead animals, or dead zombies? In fn_selfActions find
    Code:
    if ((speed player <= 1) && !_isAlive && _canDo) then {
    and change to

    Code:
    if ((speed player <= 1) && !_isAlive && _canDo && _isZombie && _isAnimal && _isMan) then {
    
    
    Remove what you don't want/need
    _isZombie makes sure the target is a dead zombie, _isAnimal makes sure its an animal, etc etc. Don't use any of those checks if you want it to work for all bodies.
Credits -
Kris

Buttface

CommanderRetra
Discussion \ help thread
Download Link
 
Now if you don't have a custom fn_selfActions / compiles, go grab them from the dayz_code.pbo and place in a Fixes folder in your mission.pbo. Find this line in your init :
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
and change it to
Code:
call compile preprocessFileLineNumbers "Fixes\compiles.sqf";
and then in your compile.sqf find the line that starts with
Code:
fnc_usec_selfActions
and change that to
Code:
fnc_usec_selfActions = compile preprocessFileLineNumbers "Fixes\fn_selfActions.sqf";        //Checks which actions for self
then follow the steps above :D
 
...simple update for this...


In setBodyBomb.sqf move the remove actions lines to above the first if line
 
Back
Top