Improved Fred's Zombie Bait/Bomb [1.7.7.1]

The idea for zombie bait and bomb comes from Fred (http://opendayz.net/threads/release-freds-zombie-bait-wip.10701/). I really liked the concept but found the code he wrote to be very limiting in terms of features and a bit buggy. So I re-wrote it and releasing it to everyone to use and improve.

These scripts allow you to set the attraction distance, attraction chance, bait duration, time it takes to craft the device, number of meat required, number of blood bags required, and number of grenades required (for the bomb). They also allow the use of any kind of raw meat as defined in dayz_code.pbo variables.sqf.

The install is a bit more complex though due to the various features I added. It is also too long to put in one post so going to break it up into a few replies to this thread.
 
mission.pbo

init.sqf
Under...
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
Add...
Code:
call compile preprocessFileLineNumbers "custom\compiles.sqf";

custom\compiles.sqf (Create a new file to hold this code unless you already have a custom one)
Code:
if (!isDedicated) then {
 
    fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf";
    zombie_findTargetAgent = compile preprocessFileLineNumbers "custom\zombie_findTargetAgent.sqf";
 
    // Initialize any custom action variables here to ensure they appear in the
    // action menu properly.
    s_player_craftZombieBait = -1;
    s_player_craftZombieBaitBomb = -1;
    a_player_customAction = false;
   
    // Add any custom actions that you want to reset here.
    fnc_resetCustomActions = {
        a_player_customAction = false;
       
        if (!(s_player_craftZombieBait < 0)) then {
            player removeAction s_player_craftZombieBait;
            s_player_craftZombieBait = -1;
        };
        if (!(s_player_craftZombieBaitBomb < 0)) then {
            player removeAction s_player_craftZombieBaitBomb;
            s_player_craftZombieBaitBomb = -1;
        };
    };
   
    // Function determines if the player is moving or standing (mostly) still.
    fnc_playerIsMoving = {
        private ["_vector","_isMoving"];
        _vector = velocity player;
        _isMoving = ((_vector select 0 > 0.3) or (_vector select 1 > 0.3) or (_vector select 2 > 0.3));
        _isMoving
    };
   
    // Function determines if the player has the parts required to make a zombie bait.
    fnc_hasZombieBaitParts = {
        private ["_meatRequired","_bloodBagsRequired","_rawmeat","_meatQty","_bloodBagQty","_canMake"];
        //-------------------------------------------------------------------------
        // THESE VARIABLES MUST MATCH THOSE SET IN player_craftZombieBait.sqf!!!
        _meatRequired = 1;         
        _bloodBagsRequired = 1;
        //-------------------------------------------------------------------------
        _rawmeat = meatraw;
        _meatQty = {_x in _rawmeat} count magazines player;
        _bloodBagQty = {_x == "ItemBloodbag"} count magazines player;
        _canMake = false;
       
        if ((_meatQty >= _meatRequired) and (_bloodBagQty >= _bloodBagsRequired)) then {
            _canMake = true;
        };
        _canMake
    };
 
    // Function determines if the player has the parts required to make a zombie bait bomb.
    fnc_hasZombieBombParts = {
        private ["_meatRequired","_bloodBagsRequired","_grenadesRequired","_grenades","_rawmeat","_meatQty","_bloodBagQty","_grenadeQty","_canMake"];
        //-------------------------------------------------------------------------
        // THESE VARIABLES MUST MATCH THOSE SET IN player_craftZombieBaitBomb.sqf!!!
        _meatRequired = 1;         
        _bloodBagsRequired = 1;
        _grenadesRequired = 1;
        _grenades = ["HandGrenade_West","HandGrenade_East"];
        //-------------------------------------------------------------------------
        _rawmeat = meatraw;
        _meatQty = {_x in _rawmeat} count magazines player;
        _bloodBagQty = {_x == "ItemBloodbag"} count magazines player;   
        _grenadeQty = {_x in _grenades} count magazines player;
        _canMake = false;
       
        if ((_meatQty >= _meatRequired) and (_bloodBagQty >= _bloodBagsRequired) and (_grenadeQty >= _grenadesRequired)) then {
            _canMake = true;
        };
        _canMake
    };
};

custom\player_craftZombieBait.sqf (Create a new file to hold this code)
Code:
//-----------------------------------------------------------------------------
// Craft Zombie Bait
//    Gives players the ability to craft zombie bait that attracts zombies for
//    a configurable amount of time.
//
// DayZ Version: 1.7.7.1 - Chernarus
//
// Author: KungFuCharlie
// 
// Contributors:
//     Original Zombie Bait script created by Freaking Fred
//         http://opendayz.net/threads/release-freds-zombie-bait-wip.10701
//
// Change Log:
//      Version 1.0.0 - [July 9, 2013]
//          Initial release of script that works on 1.7.7.1
//-----------------------------------------------------------------------------
private ["_attractDistance","_attractChance","_baitDuration","_meatRequired","_bloodBagsRequired","_craftingStartTime","_craftingUseTime","_started","_finished","_rawmeat","_removed","_dis","_sfx","_position","_heading","_createBait","_bait","_zombies","_i","_animState","_isCrafting"];
 
_attractDistance = 75;      // Distance in meters to draw zombies attention
_attractChance = 100;       // Chance a zombie is attracted to bait (30 = 30%,..,100 = 100%)
_baitDuration = 60;         // Number of seconds until bait is used up
_craftingUseTime = 5;       // Number of seconds it takes to craft bait
//-----------------------------------------------------------------------------
// These variables must be updated in your compiles.sqf file whenever they are changed!
_meatRequired = 1;          // Number of meats required to set bait
_bloodBagsRequired = 1;     // Number of blood bags required to set bait
//-----------------------------------------------------------------------------
 
player removeAction s_player_craftZombieBait;
s_player_craftZombieBait = -1;
 
a_player_customAction = true;
_craftingStartTime = time;
 
// Remove the correct number of meats from the players inventory.
_rawmeat = meatraw;
_removed = 0;
while {_removed < _meatRequired} do {
    {
        if ( _x in magazines player) exitWith { 
            player removeMagazine _x;    // ADD TO BE SCRIPTS.TXT!
            _removed = _removed + 1;
        };
    } forEach _rawmeat;
};
 
// Remove the correct number of blood bags from the players inventory.
for [{_i = 0}, {_i < _bloodBagsRequired}, {_i = _i + 1}] do
{
    player removeMagazine "ItemBloodbag";    // ADD TO BE SCRIPTS.TXT!
};
 
// Play the medic animation and alert nearby zombies.
player playActionNow "Medic";
_dis = 5;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
 
// Cancel if interrupted
r_interrupt = false;
_animState = animationState player;
r_doLoop = true; 
_started = false; 
_finished = false;
while {r_doLoop} do {
    _animState = animationState player; 
    _isCrafting = ["medic",_animState] call fnc_inString;
    
    if (_isCrafting) then {
        _started = true;
    } else {
        if (_started and !r_interrupt) then {
            if ((time - _craftingStartTime) <= _craftingUseTime) then {
                player playActionNow "Medic"; 
            } else {
                r_doLoop = false;
                _finished = true;
            };
        };
    };
    if (r_interrupt) then {
        r_doLoop = false;
    };
    sleep 0.1;
};
r_doLoop = false;
a_player_customAction = false;
 
if (_finished) then {
    // Create the bait object and set its position.
    _heading = getDir player;
    _position = getPosATL player;
    _position = [(_position select 0) + (2 * sin(_heading)), (_position select 1) + (2 * cos(_heading)), (_position select 2)];
    _createBait = createVehicle ["Land_Bucket_EP1", _position, [], 0, "CAN_COLLIDE"];    // ADD TO BE CREATEVEHICLE.TXT!
    _createBait setDir _heading;
    _createBait setPosATL _position;    // ADD TO BE SCRIPTS.TXT!
 
    _bait = nearestObject [player, "Land_Bucket_EP1"];
    _zombies = (getPosATL _bait) nearEntities ["zZombie_Base", _attractDistance];
 
    // Add the bait to the targets list of every zombie group that is within the
    // attraction zone and passes the random chance of attraction check.
    {
        private ["_chance","_group","_targets"];
        _chance = random 100;
        if (_chance <= _attractChance ) then {
            _group = group _x;
            if (isNull group _x) then {
                _group = _x;
            };
            _x reveal [_bait, 4];
            _targets = _group getVariable ["targets",[]];
            if (!(_bait in _targets)) then {
                _targets set [count _targets,_bait];
                _group setVariable ["targets",_targets,true];
            };
        };
    } forEach _zombies;
 
    titleText ["You have placed a zombie bait on the ground in front of you... You should run!", "PLAIN DOWN"]; 
    titleFadeOut 5;
 
    // Wait the correct duration and then delete the zombie bait.
    sleep _baitDuration;     
    titleText ["Your zombie bait has been depleted.", "PLAIN DOWN"]; 
    titleFadeOut 5;
    deleteVehicle _bait;
} else {
// This is for handling if interrupted
r_interrupt = false;
player switchMove "";
player playActionNow "stop";
cutText [format["Your crafting of a zombie bait has been interrupted."], "PLAIN DOWN"];
};
 
custom\player_craftZombieBaitBomb.sqf (Create a new file to hold this code)
Code:
//-----------------------------------------------------------------------------
// Craft Zombie Bait Bomb
//    Gives players the ability to craft zombie bait bomb that attracts zombies for
//    a configurable amount of time and then detonates killing all nearby.
//
// DayZ Version: 1.7.7.1 - Chernarus
//
// Author: KungFuCharlie
//
// Contributors:
//    Original Zombie Bait Bomb script created by Freaking Fred
//        http://opendayz.net/threads/release-freds-zombie-bait-wip.10701
//
// Change Log:
//      Version 1.0.0 - [July 9, 2013]
//          Initial release of script that works on 1.7.7.1
//-----------------------------------------------------------------------------
private ["_attractDistance","_attractChance","_baitDuration","_meatRequired","_bloodBagsRequired","_craftingStartTime","_craftingUseTime","_started","_finished","_hasMeatType","_rawmeat","_grenadesRequired","_grenades","_removed","_dis","_sfx","_position","_heading","_bait","_zombies","_bomb","_i","_animState","_isCrafting"];
_attractDistance = 75;      // Distance in meters to draw zombies attention
_attractChance = 100;      // Chance a zombie is attracted to bait (30 = 30%,..,100 = 100%)
_baitDuration = 30;        // Number of seconds until bait explodes
_craftingUseTime = 8;      // Number of seconds it takes to craft bait
//-----------------------------------------------------------------------------
// These variables must be updated in your compiles.sqf file whenever they are changed!
_meatRequired = 1;          // Number of meats required to set explosive bait
_bloodBagsRequired = 1;    // Number of blood bags required to set explosive bait
_grenadesRequired = 1;      // Number of grenades required to set explosive bait
_grenades = ["HandGrenade_West","HandGrenade_East"];
//-----------------------------------------------------------------------------
player removeAction s_player_craftZombieBaitBomb;
s_player_craftZombieBaitBomb = -1;
a_player_customAction = true;
_craftingStartTime = time;
// Remove the correct number of meats from the players inventory.
_rawmeat = meatraw;
_removed = 0;
while {_removed < _meatRequired} do {
    {
        if ( _x in magazines player) exitWith {
            player removeMagazine _x;    // ADD TO BE SCRIPTS.TXT!
            _removed = _removed + 1;
        };
    } forEach _rawmeat;
};
// Remove the correct number of blood bags from the players inventory.
for [{_i = 0}, {_i < _bloodBagsRequired}, {_i = _i + 1}] do
{
    player removeMagazine "ItemBloodbag";    // ADD TO BE SCRIPTS.TXT!
};
// Remove the correct number of grenades from players inventory.
for [{_i = 0}, {_i < _grenadesRequired}, {_i = _i + 1}] do
{
    if ("HandGrenade_West" in magazines player) then {
        player removeMagazine "HandGrenade_West";    // ADD TO BE SCRIPTS.TXT!
    } else {
        player removeMagazine "HandGrenade_East";
    };
};
// Play the medic animation and alert nearby zombies.
player playActionNow "Medic";
_dis = 5;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
// Cancel if interrupted
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
    _animState = animationState player;
    _isCrafting = ["medic",_animState] call fnc_inString;
   
    if (_isCrafting) then {
        _started = true;
    } else {
        if (_started and !r_interrupt) then {
            if ((time - _craftingStartTime) <= _craftingUseTime) then {
                player playActionNow "Medic";
            } else {
                r_doLoop = false;
                _finished = true;
            };
        };
    };
    if (r_interrupt) then {
        r_doLoop = false;
    };
    sleep 0.1;
};
r_doLoop = false;
a_player_customAction = false;
if (_finished) then {
    // Create the bait object and set its position.
    _heading = getDir player;
    _position = getPosATL player;
    _position = [(_position select 0) + (2 * sin(_heading)), (_position select 1) + (2 * cos(_heading)), (_position select 2)];
    _createBait = createVehicle ["Land_Bucket_EP1", _position, [], 0, "CAN_COLLIDE"];    // ADD TO BE CREATEVEHICLE.TXT!
    _createBait setDir _heading;
    _createBait setPosATL _position;    // ADD TO BE SCRIPTS.TXT!
    _bait = nearestObject [player, "Land_Bucket_EP1"];
    _zombies = (getPosATL _bait) nearEntities ["zZombie_Base", _attractDistance];
    // Add the bait to the targets list of every zombie group that is within the
    // attraction zone and passes the random chance of attraction check.
    {
        private ["_chance","_group","_targets"];
        _chance = random 100;
        if (_chance <= _attractChance ) then {
            _group = group _x;
            if (isNull group _x) then {
                _group = _x;
            };
            _x reveal [_bait, 4];
            _targets = _group getVariable ["targets", []];
            if (!(_bait in _targets)) then {
                _targets set [count _targets, _bait];
                _group setVariable ["targets", _targets, true];
            };
        };
    } forEach _zombies;
    cutText [format["You have placed a zombie bait bomb with a %1 second detonation timer... You should run!", _baitDuration], "PLAIN DOWN"];
    titleFadeOut 5;
    // Wait the correct duration and then make ze explosive bait go BOOM!
    sleep _baitDuration - 10;
    titleText ["Zombie bait bomb detonation in 10 seconds!", "PLAIN DOWN"];
    titleFadeOut 5;
    sleep 10;
    _bomb = createVehicle ["grenade", _position, [], 0, "NONE"];    // ADD TO BE SCRIPTS.TXT!
    sleep 1;
    deleteVehicle _bait;
} else {
// This is for handling if interrupted
r_interrupt = false;
player switchMove "";
player playActionNow "stop";
cutText [format["Your crafting of a zombie bait bomb has been interrupted."], "PLAIN DOWN"];
};
custom\zombie_findTargetAgent.sqf (Create a new file to hold this code)
Code:
private ["_agent","_target","_targets","_targetDis","_man","_manDis","_range","_objects","_move"];
_agent = _this;
_target = objNull;
_targets = [];
_targetDis = [];
_range = 120;
_manDis = 0;
_targets = _agent getVariable ["targets",[]];
 
if (isNil "_targets") exitWith {};
//Search for objects
if (count _targets == 0) then {
    _objects = nearestObjects [_agent, ["ThrownObjects","GrenadeHandTimedWest","SmokeShell","Land_Bucket_EP1"], 500];
    {
        private["_dis"];
if (!(_x in _targets)) then {
            _targets set [count _targets,_x];
            _targetDis set [count _targetDis,_dis];
            _move = "ZombieFeed";
            [objNull, _objects, rPlayMove, _move] call RE;
        };
    } forEach _objects;
};
 
//Find best target
if (count _targets > 0) then {
_man = _targets select 0;
_manDis = _man distance _agent;
{
private["_dis"];
_dis = _x distance _agent;
if (_dis < _manDis) then {
            _man = _x;
            _manDis = _dis;
        };
        if (_dis > _range) then {
            _targets = _targets - [_x];
        };
if (_x isKindOf "SmokeShell") then {
_man = _x;
            _manDis = _dis;
        };
    } forEach _targets;
 
    _target = _man;
};
 
//Check if too far
if (_manDis > _range) then {
_targets = _targets - [_target];
_target = objNull;
};
_target;
custom\fn_selfActions.sqf (Copy the one from dayz_code.pbo if you don't already have a custom one)
Under...
Code:
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
Add...
Code:
_isMoving = call fnc_playerIsMoving;
_isVehicle = cursorTarget isKindOf "AllVehicles";
if (!_isMoving and !a_player_customAction) then { 
    if (!_isVehicle or (_isVehicle and (player distance cursorTarget > 4))) then {
        // Zombie Bait Mod
        _hasZombieBaitParts = call fnc_hasZombieBaitParts;
        if (_hasZombieBaitParts and _canDo and !a_player_customAction) then {
            if (s_player_craftZombieBait < 0) then {
                s_player_craftZombieBait = player addAction[("<t color=""#c70000"">" + ("Craft Zombie Bait") + "</t>"),"custom\player_craftZombieBait.sqf","",2,false,true,"",""];
            };
        } else {
            player removeAction s_player_craftZombieBait;
            s_player_craftZombieBait = -1;
        };
        // Zombie Bait Bomb Mod
        _hasZombieBombParts = call fnc_hasZombieBombParts;
        if (_hasZombieBombParts and _canDo and !a_player_customAction) then {
            if (s_player_craftZombieBaitBomb < 0) then {
                s_player_craftZombieBaitBomb = player addAction[("<t color=""#c70000"">" + ("Craft Zombie Bait Bomb") + "</t>"),"custom\player_craftZombieBaitBomb.sqf","",2,false,true,"",""];
            };
        } else {
            player removeAction s_player_craftZombieBaitBomb;
            s_player_craftZombieBaitBomb = -1;
        };
    };
} else {
    call fnc_resetCustomActions;
};
Now update your Battle Eye filters!!
createVehicle.txt (need to update this to prevent being kicked by BattleEye)
Find
Code:
5 "Land_" !="Land_Fire_DZ"
And change it to...
Code:
5 "Land_" !="Land_Fire_DZ" !="Land_Bucket_EP1"
 
Some notes for scripters...

If you're creating custom actions in the action menu, you need to initialize the function variables in your compiles.sqf so that it occurs on load. See near the top of custom\compiles.sqf above. This is what fixes the case where you have to drop an item and pick it back up in order for the action to appear.

You do not have to copy the compiles.sqf from dayz_code.pbo in order to over write a function or file. Just add the update to your custom\compiles.sqf since it gets called AFTER the compiles.sqf in the dayz_code.pbo. It will over write whatever was defined there. For example look how zombie_findTargetAgent is declared above.
 
Put this on my server working great but you forgot bacon from the list how could you forget bacon the best meat in the world omg how could you =~)
 
Put this on my server working great but you forgot bacon from the list how could you forget bacon the best meat in the world omg how could you =~)


Bacon is the most amazing meat on the planet. Steak is second. Bacon wrapped steak... zomg!

Raw bacon should work. I use the list of raw meats defined in the dayz_code\init\variables.sqf file (see code snippet below).
Code:
_rawmeat = meatraw;
This way I don't have to update the list every time the DayZ devs release an update with more meat types. Code re-use, memory space optimization, and all those other software engineering principles, blah blah blah. :)

You can add cooked bacon (or any other cooked meat) to your server if you want. For example, if you want to be able to use raw or cooked meat then just add the two arrays together where they are used (in the two check parts functions in compiles.sqf and in both the crafting SQF files) or create a function to add the arrays and call the function in the places mentioned to get the combined array...

To use all raw and cooked meat...
Code:
_rawmeat = meatraw + meatcooked;    // meatcooked may not be the proper var name - look it up in variables.sqf

To use all raw meat and only cooked bacon...
Code:
_rawmeat = meatraw + ["Bacon"];    // assuming that is the class id for cooked bacon  - look it up in variables.sqf

Or if you wanted to go the function route, add this to your compiles.sqf...
Code:
fnc_meatsForCrafting = {
    private ["_allMeats"];
    _allMeats = meatraw + meatcooked; // meatcooked may not be the proper var name - look it up in variables.sqf
    _allMeats
};
... and then update all the _rawmeat = meatraw; lines to...
Code:
_allmeat = call fnc_meatsForCrafting;
... and change any uses of _rawmeat to _allmeat.

And thus Timmy went to Charlie and asked if there could be bacon, and Charlie said let there be bacon, and then there was bacon, and the bacon was good.
 
And the people asked GreyWolf if there could be a new and improved zombie bait, and GreyWolf said let there be a new and improved zombie bait, and there was a new and improved zombie bait, and the new and improved zombie bait was good, and GreyWolf thanked KungFuCharlie.
 
Tried modifying your compiles to suit my needs (not using your zombie bomb, but having same issue with menu and saw your working version) not quite sure what I fucked up along the way but nothing appears anymore. I've got loads of custom actions..so... here is my compiles
Code:
if (!isDedicated) then {
 
    fnc_usec_selfActions = compile preprocessFileLineNumbers "Fixes\fn_selfActions.sqf";
 
    // Initialize any custom action variables here to ensure they appear in the
    // action menu properly.
    s_player_selfBloodbag = -1;
    s_player_toggle = -1;
    s_player_karate = -1;
    s_player_relax = -1;
    s_player_box = -1;
    s_player_dance = -1;
    s_player_makeBomb = -1;
    s_player_Heal = -1;
 
    //Start Dynamic Weather
    execVM "DynamicWeatherEffects.sqf";
    initialized = true;
};

and my init....
Code:
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile
call compile preprocessFileLineNumbers "Fixes\compiles.sqf"; //Compile custom compiles
progressLoadingScreen 1.0;
 
You have a colon instead of a semi-colon. That will cause a script error and prevent it from running.

s_player_Heal = -1:

That was actually added as an after thought, I just added that action in when I was testing this and forgot to add it into the list that I posted here, I edited the post but mistyped...it didn't work without that line xD my bad

^ that sounds like I posted here before I tested, I tested, then posted here (just to clear it up xD)
 
Value Restriction #329 "remExField" = [<NULL-object>,[<NULL-object>,<NULL-object>,<NULL-object>],"playmove","ZombieFeed"]

can somebody help me ? :D
 
Worked great, just made one quick edit! Added it to right click action as some people was putting down bait instead of blood bagging.

For those interested to add it as a right click action
Remove from fn_selfActions.sqf
Code:
_isMoving = call fnc_playerIsMoving;
_isVehicle = cursorTarget isKindOf "AllVehicles";
if (!_isMoving and !a_player_customAction) then {
    if (!_isVehicle or (_isVehicle and (player distance cursorTarget > 4))) then {
        // Zombie Bait Mod
        _hasZombieBaitParts = call fnc_hasZombieBaitParts;
        if (_hasZombieBaitParts and _canDo and !a_player_customAction) then {
            if (s_player_craftZombieBait < 0) then {
                s_player_craftZombieBait = player addAction[("<t color=""#c70000"">" + ("Craft Zombie Bait") + "</t>"),"custom\player_craftZombieBait.sqf","",2,false,true,"",""];
            };
        } else {
            player removeAction s_player_craftZombieBait;
            s_player_craftZombieBait = -1;
        };
        // Zombie Bait Bomb Mod
        _hasZombieBombParts = call fnc_hasZombieBombParts;
        if (_hasZombieBombParts and _canDo and !a_player_customAction) then {
            if (s_player_craftZombieBaitBomb < 0) then {
                s_player_craftZombieBaitBomb = player addAction[("<t color=""#c70000"">" + ("Craft Zombie Bait Bomb") + "</t>"),"custom\player_craftZombieBaitBomb.sqf","",2,false,true,"",""];
            };
        } else {
            player removeAction s_player_craftZombieBaitBomb;
            s_player_craftZombieBaitBomb = -1;
        };
    };
} else {
    call fnc_resetCustomActions;
};

If you don't already have Extra_rc.hpp get it here http://epochservers.com/viewtopic.php?f=14&t=13
and follow the instructions, once done add

Code:
class ExtraRc {
    class ItemBloodBag {
        class Bait {
            text = "Make Bait";
            script = "execVM 'custom\player_craftZombieBait.sqf';"
        };
       class HandGrenade_west {
            text = "Craft Z bomb";
            script = "execVM 'custom\player_craftZombieBaitBomb.sqf';"
        };
    };
};

Add a third one for HandGrenade_East too!

It can also be done using Right click action from this script too! http://epochmod.com/forum/index.php...ble-db-saving-plot-vehiclesbuildings-packing/

By adding the following lines to Overwrites>Click actions>Config.sqf

["ItemBloodBag","Make Bait","execVM 'custom\player_craftZombieBait.sqf';","true"],
["HandGrenade_west","Make Bait","execVM 'custom\player_craftZombieBaitBomb.sqf';","true"],
["HandGrenade_east","Make Bait","execVM 'custom\player_craftZombieBaitBomb.sqf';","true"]

Make sure there is no comma on the last line, or that one will not work.

Hope this helps
 
Back
Top