Jump to content

[WIP] UPDATING, Major Overhaul. Preview


Leigham

Recommended Posts

Im working on updating my menu to be a dialog, with extra options, including messaging players.87EDB6F07F89D7462876E0B28763DB21403BF0D8

There is a preview below, let me get some feedback, the overall look of it isnt finished, and I may add/change it, but the basic functions are in. 

http://images.akamai.steamusercontent.com/ugc/436076195945171589/87EDB6F07F89D7462876E0B28763DB21403BF0D8/

Edited by Leigham
Link to comment
Share on other sites

I've tested as an admin using this and it seems to work even with the standard antihack enabled:

InitPlayerLocal.sqf:

if (!isDedicated and hasInterface) then 
{
	while {true} do
	{
		waitUntil {alive vehicle player};
		Sleep 30;
		[] execVM "custom\admin_menu.sqf";
		waitUntil {!alive player};
		Sleep 30;
		[] execVM "custom\admin_menu.sqf";
	};
};
custom\admin_menu.sqf:

//Admin scroll options
if ((getPlayerUID player) in admin_list) then 
{
		player removeAction _menuList1;
		player removeAction _menuList2;
		player removeAction _menuList3;
		player removeAction _menuList4;
		player removeAction _menuList5;
		
		_menuList1 = player addaction [("" + ("=== Admin Menu ===") +""),"","",5,false,true,"",""];
		_menuList2 = player addaction [("" + ("Spawn Base Kit") +""),"custom\crate_building.sqf","",5,false,true,"",""];
		_menuList3 = player addaction [("" + ("Spawn Weapon Crate Full") +""),"custom\crate_weapons.sqf","",5,false,true,"",""];
		_menuList4 = player addaction [("" + ("Spawn Weapon Crate Standard") +""),"custom\crate_weapons2.sqf","",5,false,true,"",""];
		_menuList5 = player addaction [("" + ("==================") +""),"","",5,false,true,"",""];	

};
custom\crate_building.sqf:

if ((getPlayerUID player) in admin_list) then 
{
	_cnt = 3;
	_locationPlayer = (getPosATL player);
	for "_p" from 1 to 3 do
	{
	systemChat(format ["WARNING! Spawning in %1s - Move to cancel",_cnt]);
	if (player distance _locationPlayer > 0.2) then {
	systemChat("Action cancelled");
	breakOut "exit";
	};
	sleep 1;
	_cnt = _cnt - 1;
	};

	_object = "box_nato_ammoveh_f" createVehicle (position player);
	_object setDir ((getDir player) + 90);
	_object setVariable ["ObjectID", "1", true];
	_object setVariable ["ObjectUID", "1", true];

	clearBackpackCargoGlobal _object;
	clearMagazineCargoGlobal _object;
	clearWeaponCargoGlobal _object;
	clearItemCargoGlobal _object;

	_object addItemCargoGlobal ["CinderBlocks", 50];
	_object addItemCargoGlobal ["ChainSaw", 50];
	_object addItemCargoGlobal ["ItemMixOil", 50];
	_object addItemCargoGlobal ["jerrycan_epoch", 50];
	_object addItemCargoGlobal ["EnergyPackLg", 50];
	_object addItemCargoGlobal ["MortarBucket", 50];
	_object addItemCargoGlobal ["ItemCorrugated", 50];
	_object addItemCargoGlobal ["CircuitParts", 50];
	_object addItemCargoGlobal ["PaintCanBlk", 50];
	_object addItemCargoGlobal ["PaintCanBlu", 50];
	_object addItemCargoGlobal ["PaintCanBrn", 50];
	_object addItemCargoGlobal ["PaintCanGrn", 50];
	_object addItemCargoGlobal ["PaintCanOra", 50];
	_object addItemCargoGlobal ["PaintCanPur", 50];
	_object addItemCargoGlobal ["PaintCanRed", 50];
	_object addItemCargoGlobal ["PaintCanTeal", 50];
	_object addItemCargoGlobal ["PaintCanYel", 50];
	_object addItemCargoGlobal ["ItemScraps", 50];
	_object addItemCargoGlobal ["ItemCorrugated", 50];
	_object addItemCargoGlobal ["ItemCorrugatedLg", 50];
	_object addItemCargoGlobal ["PartPlankPack", 50];
	_object addItemCargoGlobal ["WoodLog_EPOCH", 50];
	_object addItemCargoGlobal ["KitStudWall", 50];
	_object addItemCargoGlobal ["KitWoodFloor", 50];
	_object addItemCargoGlobal ["KitWoodStairs", 50];
	_object addItemCargoGlobal ["KitWoodRamp", 50];
	_object addItemCargoGlobal ["KitShelf", 50];
	_object addItemCargoGlobal ["KitPlotPole", 50];
	_object addItemCargoGlobal ["KitCinderWall", 50];
	_object addItemCargoGlobal ["KitFoundation", 50];
	_object addItemCargoGlobal ["KitTiPi", 50];	
	_object addItemCargoGlobal ["ItemLockbox", 50];
	_object addItemCargoGlobal ["MultiGun", 50];
	_object addItemCargoGlobal ["MeleeSledge", 50];
	_object addItemCargoGlobal ["Hatchet", 50];  

	_object attachto [player,[0.0,5.0,0]];

	cutText [format["After 5 seconds the item will be set in place so pick a spot fast."], "PLAIN DOWN"];

	sleep 5;
	detach _object;
	player reveal _object;

	_object setPos [(getPos _object select 0), (getPos _object select 1), (getPosATL player select 2)];

	sleep 3;
	r_interrupt = false;
	player switchMove "";
	player playActionNow "stop";

	sleep 10;

	cutText [format["Warning: Spawned constructions DO NOT SAVE after server restart!"], "PLAIN DOWN"];
};
admin.sqf (placed in the same folder as @epochhive):

admin_list = ["xxx"];     
publicVariable "admin_list";
Call for the admin.sqf added to mission.sqm:

		class Item1
		{
			side = "CIV";
			class Vehicles
			{
				items = 1;
				class Item0
				{
					position[] = {14089.341,11.245888,11558};
					azimut = 130.016;
					special = "NONE";
					id = 1;
					side = "CIV";
					vehicle = "VirtualMan_EPOCH";
					player = "PLAY CDG";
					leader = 1;
					skill = 0.6;
					init="if (isServer) then {execVM ""\admin.sqf"";};"; 
				};
			};
		};
Link to comment
Share on other sites

So if you can add an add action to vehicles why wouldnt you add action to repair a vehicle with the option to remove krypto from player? And you could even spawn players with krypto as a fresh spawn.

I will look into putting a repair vehicle action in there too : D Good Idea :D 

 

Link to comment
Share on other sites

Well I was messing with client side action menus and was able to spawn items in but deleted on restarts. My experience is only vehicles get cleaned up by the server so it should be possible.

I don't mind if they get deleted on restart but I can't get them to stay for more than 2-3 seconds before they vanish.

Would you mind showing the code you use to spawn them?

Link to comment
Share on other sites

Anyone know how to trigger spawning a vehicle which is on the allowed vehicles list and make it not get deleted by the antihack after a few seconds?

 

This code can help

if (isServer) then {



_veh1 = ObjNull;
    _veh1 = createVehicle["B_Heli_Light_01_EPOCH", [14273.1, 13115.7, 8.35157], [], 0, "NONE"];
	_veh1 setDir 353.965;
    _veh1 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _veh1 setVariable["LAST_CHECK",1000000000000];
                _veh1 call EPOCH_server_setVToken;    
            addToRemainsCollector[_veh1];	
        clearWeaponCargoGlobal    _veh1;
        clearMagazineCargoGlobal  _veh1;
        clearBackpackCargoGlobal  _veh1;
    clearItemCargoGlobal       _veh1;

};

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
  • Advertisement
×
×
  • Create New...