DarrikVkir
Member
Greetings,
I'm working on implementing VFLadder into my server. I've got it working... to a point. I've added this code to selfActions (Actual adds starts at if(_canDo) then ):
I've got the if statement wide open except for canDo atm for testing purposes, although I intend to add scrap metal as a requirement to it.
However, the createladder actions only show up if I'm close enough to an object that (I assume) my cursor target is on it. As you can see, I've got base building installed, and the 'build recipes' menu shows up regardless of what my cursor target is so I know it's possible, but I can't figure out how it's doing it. Here's the build recipe code:
I must be missing something, but I can't for the life of me figure it out.
I'm working on implementing VFLadder into my server. I've got it working... to a point. I've added this code to selfActions (Actual adds starts at if(_canDo) then ):
Code:
if (!isNull _nearLight) then {
if (_nearLight distance player < 4) then {
_canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
};
};
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
//Start DV add
if(_canDo) then {
if (s_player_createladder <0) then {
s_player_createladder = player addAction [format["Create Small Ladder"], "VFladder\createladder.sqf",[player,0], 0, false, true, "",""];
s_player_createladder2 = player addAction [format["Create Big Ladder"], "VFladder\createladder.sqf",[player,1], 0, false, true, "",""];
};
};
//End DV add
//##### BASE BUILDING 1.2 Custom Actions (CROSSHAIR IS TARGETING NOTHING) #####
I've got the if statement wide open except for canDo atm for testing purposes, although I intend to add scrap metal as a requirement to it.
However, the createladder actions only show up if I'm close enough to an object that (I assume) my cursor target is on it. As you can see, I've got base building installed, and the 'build recipes' menu shows up regardless of what my cursor target is so I know it's possible, but I can't figure out how it's doing it. Here's the build recipe code:
Code:
//##### BASE BUILDING 1.2 Custom Actions (CROSSHAIR IS TARGETING NOTHING) #####
_currentSkin = typeOf(player);
// Get closest camonet since we cannot target with crosshair Base Building Script, got lazy here, didnt fix with array
camoNetB_East = nearestObject [player, "Land_CamoNetB_EAST"];
camoNetVar_East = nearestObject [player, "Land_CamoNetVar_EAST"];
camoNet_East = nearestObject [player, "Land_CamoNet_EAST"];
camoNetB_Nato = nearestObject [player, "Land_CamoNetB_NATO"];
camoNetVar_Nato = nearestObject [player, "Land_CamoNetVar_NATO"];
camoNet_Nato = nearestObject [player, "Land_CamoNet_NATO"];
// Check mags in player inventory to show build recipe menu
_mags = magazines player;
if ("ItemTankTrap" in _mags || "ItemSandbag" in _mags || "ItemWire" in _mags || "PartWoodPile" in _mags || "PartGeneric" in _mags) then {
hasBuildItem = true;
} else { hasBuildItem = false;};
//Build Recipe Menu Action
if((speed player <= 1) && hasBuildItem && _canDo) then {
if (s_player_recipeMenu < 0) then {
s_player_recipeMenu = player addaction [("<t color=""#0074E8"">" + ("Build Recipes") +"</t>"),"buildRecipeBook\build_recipe_dialog.sqf","",5,false,true,"",""];
};
} else {
player removeAction s_player_recipeMenu;
s_player_recipeMenu = -1;
};
I must be missing something, but I can't for the life of me figure it out.