Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Community Reputation

550 Excellent

About davidoss

  • Rank
    Sergeant Major

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

3419 profile views

Single Status Update

See all updates by davidoss

  1. /*
    file: VEH_fnc_xehInit.sqf
    by DaVidoSS
    add possibility to automatically turn back vehicle on wheels once flipped
    to event take place vehicle needs to be side/up flipped and empty and no units in 10m around
    created for Barbolani's Antistasi
    0: OBJECT
    return VOID
    params [["_vehicle",objNull,[objNull]]];
    if (!isServer) exitWith {};
    if (!((getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "hasDriver")) isEqualTo 1)) exitWith {};
    _vehicle addEventHandler ["GetOut", {
    	private _vehicle = param [0, objNull, [objNull]];
    	if !((crew _vehicle) isEqualTo []) exitWith {}; //skip if anyone still in veh
    	(_vehicle call BIS_fnc_getPitchBank) params ["_vx","_vy"];
    	if (([_vx,_vy] findIf {_x > 80 || _x < -80}) != -1) then {	
    		0 = [_vehicle] spawn {
    			private _vehicle = param [0, objNull, [objNull]];
    			waitUntil {(_vehicle nearEntities ["Man", 10]) isEqualTo [] || !alive _vehicle};
    			if (!alive _vehicle) exitWith {};
    			_vehicle allowDamage false;
    			_vehicle setVectorUp [0,0,1];
    			_vehicle setPosATL [(getPosATL _vehicle) select 0, (getPosATL _vehicle) select 1, 0];
    			_vehicle allowDamage true;

    Hi Davidoss, I saw your post where you showed your script about unflipping vehicles.

    I found this very cool as should be very usefull. I just wanted to ask if you would show me how to change it so that it doesnt matter if a crew is inside or not.

    Because in my missione the AI will not use vehicles anymore when they left them. If vehicles are on roof the ai just stays inside and after a while they go by foot.





    1. davidoss


      Unfortunately leave vehicle is the main event handler here which  fires the code.

      Its because of hold performance.

      You can use loop which will check vehicle pitch and bank all the time but is just somet5hing what will heavy load the game with some count of vehicles