Jump to content
  • 0

Vehicle Flip


webbie

Question

Hi all, Ive been looking for a while now for a vehicle flip script for a single player.

Ive tried stuff ive used on previous servers but its not allowing the option so im guessing epoch has something that interferes with it.

If anyone knows of a simple script to allow players to do this could you link it to me please,

Thanks in advance.

PS. Im aware the jacks flip vehicles but I actually  find this to be incredibly painstaking unless theirs a trick to it.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1

And here is a better solution, now using the dynaMenu and checking that the vehicle is unlocked and you were the last driver (thus dealing with the issue of object locality). All changes are in the mission file.

Add the following to epoch_config/Configs/CfgActionMenu/CfgActionMenu_target.hpp:

// Flip Vehicle
class flip_vic
{
	condition = "dyna_isVehicle && !dyna_locked";
	action = "[dyna_cursorTarget] call FlipVic;";
	icon = "x\addons\a3_epoch_code\Data\UI\buttons\build_upgrade.paa";
	tooltip = "Flip Vehicle";
};

Add a script in the folder where you store your custom ones, for example custom/, called FlipVehicle.sqf with the following contents:

private ["_target"];

_target = _this select 0;

if (local _target) then {
	_target setVectorUp [0, 0, 1];
	["Flipped vehicle",5] call epoch_message;
} else {
	["You were not the driver of this vehicle",5] call epoch_message;
};

Add the following lines into your mission's init.sqf replacing the script's folder with where ever you put yours:

if(hasInterface) then{
	FlipVic  = compileFinal  preprocessFileLineNumbers "custom\FlipVehicle.sqf";
};

RePBO the mission, upload to the server...

Link to comment
Share on other sites

  • 0

@webbieAt a very simplistic level, add a script called custom/flip_vehicle.sqf with the following code:

_target = cursorTarget;

if((!isNull _target) && {alive _target} && {_target isKindOf 'Landvehicle' || _target isKindOf 'Air' || _target isKindOf 'Ship'})then {
	_target setVectorUp [0, 0, 1];
	['Flipped vehicle!',0,0.7,2,0] spawn bis_fnc_dynamictext;
};

Add the following line to initPlayerLocal.sqf in the root of your mission file:

	flipvic = player addAction ["<t color=""#F8FF24"">" +"Flip Vehicle","custom\flip_vehicle.sqf","",1,false,false,"",""];	

You now have a scroll wheel action to flip a vehicle. 

Will add some code to check you are the driver (which as an aside also handles the locality issue in MP) and post an update later. 

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
  • Discord

×
×
  • Create New...