Jump to content

Base Destruction Dome (Admin Script)


Axe Cop

Recommended Posts

 

Yeah here a simple step by step guide if you don't have any admin tools:

 

Step 1) save my base destruction script in the mission folder as "admintools\basedestruction.sqf"

 

Step 2) create a file "admintools\openmenu.sqf" and copy the menu stuff in there, e.g.

if (isNil "BD_vehicles") then {BD_vehicles = true;};

BaseDestructionMenu =

[

    ["Base Destruction",true],

        ["Set Center", [2], "", -5, [["expression", '["center] execVM "admintools\basedestruction.sqf"']], "1", "1"],

        ["Set Radius", [3], "", -5, [["expression", '["radius] execVM "admintools\basedestruction.sqf"']], "1", "1"],

        ["Show Dome", [4], "", -5, [["expression", '["dome] execVM "admintools\basedestruction.sqf"']], "1", "1"],

        [format["Include Vehicles (%1)",BD_vehicles], [5], "", -5, [["expression", "BD_vehicles = !BD_vehicles;"]], "1", "1"],

        ["DESTROY ALL INSIDE DOME", [6], "", -5, [["expression", '["destroy] execVM "admintools\basedestruction.sqf"']], "1", "1"],

        ["", [-1], "", -5, [["expression", ""]], "1", "0"],

            ["Exit", [13], "", -3, [["expression", ""]], "1", "1"]

];

showCommandingMenu "#USER:BaseDestructionMenu";

Step 3) to ensure only admins can open and use the menu add this to your fn_selfActions.sqf after "_canDo" as usual:

if (((getPlayerUID player) in ["YOURPLAYERID"]) && (speed player <= 1) && _canDo) then {

    if (s_player_adminTools < 0) then {

        s_player_adminTools = player addaction [("<t color=""#0074E8"">Tools Menu</t>"),"admintools\openmenu.sqf","",5,false,true,"",""];

    }

} else {

    player removeAction s_player_adminTools;

    s_player_adminTools = -1;

};

replace "YOURPLAYERID" with your player UID or a list of IDs for multiple admins ("YOURPLAYERID", "YOURPLAYERID", ..).

 

That is it, I think  :)

  followed this and i get the tools menu but no option to do anything ????

Link to comment
Share on other sites

I follow your instruction but no menu when i sroll :s

 

I add a the end of my fn_selfaction:

 

if (((getPlayerUID player) in ["6812294"]) && (speed player <= 1) && _canDo) then {

    if (s_player_adminTools < 0) then {

        s_player_adminTools = player addaction [("<t color="#0074E8"">Tools Menu</t>"),"admintools\openmenu.sqf","",5,false,true,"","];

    }

} else {

    player removeAction s_player_adminTools;

    s_player_adminTools = -1;

};

 

 

My admin menu works (bluphoenix) but "Tools Menu" doesn't work

If you have blue phoenix already running you don't need to add that, that post was only for admins who have no admin tools at all... read the first post how to integrate in your admin tools. :)

Link to comment
Share on other sites

Easy to remove the explosion? I do love the sound though, scares players :D

If you just want to remove the building parts and not destroy it uncomment my alternate code, like this:

if (alive _x) then {
	_objectID = _x getVariable ["ObjectID", "0"];
	_objectUID = _x getVariable ["ObjectUID", "0"];
	PVDZE_obj_Delete = [_objectID, _objectUID, player];
	publicVariableServer "PVDZE_obj_Delete";
	//_x setDamage 1;
	deleteVehicle _x;
	_i = _i + 1;
};

that will just delete the objects from the game AND from the database! no explosion, no destroyed building parts.

Link to comment
Share on other sites

Not stupid at all. I've worked in tech support before. :) Yes, they were working before I tried to add this script. I changed some of the Menu option names but I can't imagine that would break the whole tool mod. My AdminToolsMain is here (truncated the non-changed parts:

WHAT NOT TO DO:


DHGriffinMenu = 
[
	["",true],
		["Set Center", [2], "", -5, [["expression", '["center"] format[_EXECscript6,"DHGriffin.sqf"']], "1", "1"],
		["Set Radius", [3], "", -5, [["expression", '["radius"] format[_EXECscript6,"DHGriffin.sqf"']], "1", "1"],
		["Preview Dome", [4], "", -5, [["expression", '["dome"] format[_EXECscript6,"DHGriffin.sqf"']], "1", "1"],
		[format["Include Vehicles (%1)",BD_vehicles], [5], "", -5, [["expression", "BD_vehicles = !BD_vehicles;"]], "1", "1"],
		["FIRE IN THE HOLE!", [6], "", -5, [["expression", '["destroy"] format[_EXECscript6,"DHGriffin.sqf"']], "1", "1"],
		["Select Single Object", [7], "", -5, [["expression", '["selectSingle"] format[_EXECscript6,"DHGriffin.sqf"']], "1", "1"],
		["Destroy Single Object", [8], "", -5, [["expression", '["destroySingle"] format[_EXECscript6,"DHGriffin.sqf"']], "1", "1"],
		["", [-1], "", -5, [["expression", ""]], "1", "0"],
			["Exit", [13], "", -3, [["expression", ""]], "1", "1"]
];

Link to comment
Share on other sites

well first of all you changed my menu, doesn't work like that with the "_EXECscript6" variable thats why I did NOT use it in my menu! look up what the variable "_EXECscript6" does:

_EXECscript6 = 'player execVM "'+_pathtoDHGriffin+'%1"';

or whatever, but the point is it uses the "player" as parameter to the script, but my script needs different parameters like you see in my first post: ["center"], ["radius"] or whatever, that is why you can't simply use the _EXECscript6 variable which is stupid anyway! :D

I Hope you now what to do now? Only change it if you know what you are doing please ^^

 

here what you did is this:

["center"] format[_EXECscript6,"DHGriffin.sqf"'

remove the format and your get: (btw you can't put an array in front of "format", that is a script error in the first place I think, also the quotations are wrong!)

["center"] player execVM "admintools\DHGriffin\DHGriffin.sqf'

that is no valid script so a script error should be logged to your report file! =)

 

you could remove the "player" parameter from the variable, I have no idea why it is used as default parameter anyway, makes no sense and is never used in any of the scripst as far as i know :P

Link to comment
Share on other sites

Oops! I gave you one of my edited versions. I actually only changed that menu as a last resort. I originally copy/pasted exactly what you listed in the original post but the same problem emerged so I was tinkering out of sheer desperation by that point. When I get back to my home computer I'll post the first way I did it.

 

Also, the server report log wasn't spitting out any errors at all that I could tell.

Link to comment
Share on other sites

Also, the server report log wasn't spitting out any errors at all that I could tell.

that may be because you are looking at the wrong file, this is client code => client report file, not on the server! :D

yes there is a report file on the client to, many admins don't know about that haha

take a look at this, it tells you where the file is saved on your PC: http://community.bistudio.com/wiki/RPT#ARMA_2_OA

Link to comment
Share on other sites

  • 2 weeks later...

Although I find I have one issue more. Using the Single Object code that MrTesla posted up, for some reason it will not let me select vehicles. Even if the Vehicle variable is set to True.

 

Code follows:

case "selectSingle": {
		_objectClasses =  ["TentStorage","TentStorageDomed","TentStorageDomed2","Hedgehog_DZ","Sandbag1_DZ","TrapBear","Fort_RazorWire","WoodGate_DZ","Land_HBarrier1_DZ","Land_HBarrier3_DZ","Land_HBarrier5_DZ","FireBarrel_DZ","GunRack_DZ","BagFenceRound_DZ","Fence_corrugated_DZ","M240Nest_DZ","CanvasHut_DZ","ParkBench_DZ","MetalGate_DZ","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","Plastic_Pole_EP1_DZ","Generator_DZ","StickFence_DZ","LightPole_DZ","FuelPump_DZ","DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ","SandNest_DZ","DeerStand_DZ","MetalPanel_DZ","WorkBench_DZ","WoodFloor_DZ","WoodLargeWall_DZ","WoodLargeWallDoor_DZ","WoodLargeWallWin_DZ","WoodSmallWall_DZ","WoodSmallWallWin_DZ","WoodSmallWallDoor_DZ","WoodFloorHalf_DZ","WoodFloorQuarter_DZ","WoodStairs_DZ","WoodStairsSans_DZ","WoodSmallWallThird_DZ","WoodLadder_DZ","Land_DZE_GarageWoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_WoodDoor","Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallHalf_DZ","CinderWall_DZ","CinderWallDoorway_DZ","CinderWallDoor_DZ","CinderWallDoorLocked_DZ","CinderWallSmallDoorway_DZ","CinderWallDoorSmall_DZ","CinderWallDoorSmallLocked_DZ","MetalFloor_DZ","WoodRamp_DZ","VaultStorageLocked","LockboxStorageLocked"];
		if (BD_vehicles) then {
			_objectClasses = _objectClasses + ["LandVehicle","Helicopter","Plane","Ship"];
		};
		if (typeOf(cursorTarget) in _objectClasses) then {
			objSelection = cursorTarget;
			objName = getText (configFile >> "CfgVehicles" >> (typeOf objSelection) >> "displayName");
			cutText [format["%1 selected", objName], "PLAIN DOWN"];
		} else {
			cutText ["Cannot select that object.", "PLAIN DOWN"];
		};
	};
	case "destroySingle": {
		if (isNil "objSelection") then {
			cutText ["No object selected", "PLAIN DOWN"];
		} else {
			if (alive objSelection) then {
				objSelection setDamage 1;
				deleteVehicle objSelection;
				cutText [format["%1 Deleted", objName], "PLAIN DOWN"];
				objSelection = nil;
			};
		};
	};
Link to comment
Share on other sites

hi, that may be because MrTesla added this check:

if (typeOf(cursorTarget) in _objectClasses) then

which will never be true for vehicles since "in" does not check for derived classes if you know what I mean. It works for base building since the object classes list contains every single item class, but for vehicles just the base classes like "LandVehicle" and not every single car class itself.

What you can do is eitehr remove the "if" or do it properly with isKindOf if you know how to do that. but this is an "error" in the script and not your mistake, just to be clear :D

Link to comment
Share on other sites

Alright, well I tried to remove the if check entirely but that just broke the whole select single object script. I think I understand how isKindOf works. Would this work, do you think?

if (typeOf(cursorTarget) in _objectClasses) or (typeOf(cursorTarget) isKindOf ["LandVehicle","Helicopter","Plane","Ship"]) then
Link to comment
Share on other sites

 

Alright, well I tried to remove the if check entirely but that just broke the whole select single object script. I think I understand how isKindOf works. Would this work, do you think?

if (typeOf(cursorTarget) in _objectClasses) or (typeOf(cursorTarget) isKindOf ["LandVehicle","Helicopter","Plane","Ship"]) then

I think you can only check for one class at a time, so better do it this way:

if ((typeOf(cursorTarget) in _objectClasses) or (cursorTarget isKindOf "LandVehicle") or (cursorTarget isKindOf "Helicopter") or (cursorTarget isKindOf "Plane") or (cursorTarget isKindOf "Ship")) then

looks a little messy but it's the only way to do this, or use a loop :D

Edited by Axe Cop
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
×
×
  • Create New...