Nick Stewart

Player corpse falls from destroyed vehicle.

15 posts in this topic

On 11/12/2016 at 2:36 AM, Guest said:

Simple and basic salvage vehicle implementation.

SalvageVehicle.sqf


private ["_salvage"];
player playMove "AinvPknlMstpSnonWnonDr_medic1";
sleep 10;
deleteVehicle (_this select 0);

config.cpp (add for each type like car, air, boat...)


		// Salvage Vehicle
            class Salvage: ExileAbstractAction
            {
                title = "Salvage Vehicle";
                condition = "(!(alive (ExileClientInteractionObject)))";
                action = "_this call NR_fnc_SalvageVehicle";
            };

initPlayerLocal.sqf


NR_fnc_SalvageVehicle = compileFinal preprocessFileLineNumbers "SalvageVehicle.sqf";

Your welcome.

PS: Please, hit Like if you like or use. Video example:

https://tlgur.com/d/vg3Eyv83

Could someone kindly explain this better/ how to add to a server. 

Cheers.

Share this post


Link to post
Share on other sites
Advertisement

Posted (edited)

place the SalvageVehicle.sqf   to root of your mpmission pbo.

place the

		// Salvage Vehicle
            class Salvage: ExileAbstractAction
            {
                title = "Salvage Vehicle";
                condition = "(!(alive (ExileClientInteractionObject)))";
                action = "_this call NR_fnc_SalvageVehicle";
            };

in each section for air, car, boat, bike in the config file in your mission pbo.   its the intraction menu your looking for.   

and then add the last line on the file it tells u to.   its all in your mission pbo.

Spoiler

    class Boat
    {
        targetType = 2;
        target = "Ship";

        class Actions
        
{
            // Locks a vehicle
            class Lock: ExileAbstractAction
            {
                title = "Lock";
                condition = "((locked ExileClientInteractionObject) isEqualTo 0) && ((locked ExileClientInteractionObject) != 1)";
                action = "true spawn ExileClient_object_lock_toggle";
            };

            // Unlocks a vehicle
            class Unlock: ExileAbstractAction
            {
                title = "Unlock";
                condition = "((locked ExileClientInteractionObject) isEqualTo 2) && ((locked ExileClientInteractionObject) != 1)";
                action = "false spawn ExileClient_object_lock_toggle";
            };

            // Hot-wires a vehicle
            class Hotwire: ExileAbstractAction
            {
                title = "Hotwire";
                condition = "((locked ExileClientInteractionObject) isEqualTo 2) && ((locked ExileClientInteractionObject) != 1)";
                action = "['HotwireVehicle', _this select 0] call ExileClient_action_execute";
            };

            // Repairs a vehicle to 100%. Requires Duckttape
            class Repair: ExileAbstractAction
            {
                title = "Repair";
                condition = "true";
                action = "['RepairVehicle', _this select 0] call ExileClient_action_execute";
            };

            // Fills fuel from a can into a car
            class Refuel: ExileAbstractAction
            {
                title = "Refuel";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call ExileClient_object_vehicle_refuel";
            };

            // Drains fuel from a car into an empty jerry can
            class DrainFuel: ExileAbstractAction
            {
                title = "Drain Fuel";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call ExileClient_object_vehicle_drain";
            };

            // Pushes a boat into look direction to move into water
            class Push: ExileAbstractAction
            {
                title = "Fus Ro Dah!";
                condition = "((crew ExileClientInteractionObject) isEqualTo [])";
                action = "_this call ExileClient_object_vehicle_push";
            };
            class ClaimVehicle: ExileAbstractAction
            {
                title = "Claim Ownership";
                condition = "true";
                action = "call ExileClient_ClaimVehicles_network_claimRequestSend";
            };

            class Paint : ExileAbstractAction
            {
                title = "Paint Vehicle";
                condition = "((locked ExileClientInteractionObject) isEqualTo 0) && ((locked ExileClientInteractionObject) != 1) && (ExileClientNearPaintShop)";
                action = "ExileClientInteractionObject call HALV_paintshop_opendialog";
            };
        // Salvage Vehicle
            class Salvage: ExileAbstractAction
            {
                title = "Salvage Vehicle";
                condition = "(!(alive (ExileClientInteractionObject)))";
                action = "_this call NR_fnc_SalvageVehicle";
            };
        };
    };

 

Edited by Outlawedz

Share this post


Link to post
Share on other sites

I have a question, it is possible to make from the car dropped other things and money?

private ["_salvage"];
player playMove "AinvPknlMstpSnonWnonDr_medic1";
sleep 10;
deleteVehicle (_this select 0);

(I don't know the syntax)
if bla-bla delete player_vehicle
bla-bla additems from player_vehicle

 

Share this post


Link to post
Share on other sites

Posted (edited)

Maybe ?

private ["_salvage"];
player playMove "AinvPknlMstpSnonWnonDr_medic1";


getContainerItems = {
	private _return = [];
	{
	_name = _x select 0;
	_object = _x select 1;
	
	_mags = magazinesAmmo _object;
	_weaps = weaponsItems _object;
	_items = itemCargo _object;
	_containers = everyContainer _object;
	
	_containers = if (_containers isEqualTo []) then {[]} else {_containers call getContainerItems};
	
	_return pushBack [_name,_mags,_items,_weaps,_containers];
	
	} foreach _this;
	_return
};

_veh = cursorObject;
_top_mags = magazinesAmmoCargo _veh;

_top_weaps = weaponsItemsCargo _veh;

_top_items = itemCargo _veh;

_top_containers = everyContainer _veh;  

_containers = if (_top_containers isEqualTo []) then {[]} else {_top_containers call getContainerItems};

return = [_top_mags,_top_items,_top_weaps,_top_containers];

sleep 10;
deleteVehicle (_this select 0);

I Take this code from BIS Forum

 

Edited by leonardos1978

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.