Jump to content
  • 0

[REQUEST] upgradable vehicles (not talking about magazine/document upgrades)


AG.Ndogg97

Question

Just curious if it would be possible to make say an suv upgrade to an armored suv with say X amount of scrap metal and an engine for the guns motor or some similar bullshit lol I think you get what I'm saying. This could also be done with a Humvee into a gpk, the regular motorized boat into the armed one, a unarmed bell into an armed one and so on and so on. If anyone would know how to do this or knows of a script that does please let me know. Your help is much appreciated thanks a ton!

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Here is an example:

This code will upgrade a bicycle to a motorbike.

 

 

Add this above //Grab Flare in fn_selfActions.sqf

if((speed player <= 1) && cursorTarget isKindOf "Old_bike_TK_CIV_EP1" && _canDo) then {

if (s_player_deploybike5 < 0) then {
                s_player_upgrade1 = player addaction[("<t color=""#007ab7"">" + ("Upgrade to Motor-bike") +"</t>"),"upgrade\bikeToMoterbike.sqf","",5,false,true,"", ""];
        };
} else {
        player removeAction s_player_upgrade1 ;
        s_player_upgrade1 = -1;
};

And bikeToMoterbike.sqf in a folder called upgrade. This is where all your upgrades will go.

 

NOTE: they will not save after restart tho.

Link to comment
Share on other sites

  • 0

You could also use Maca's right click addon, and have any of the items to combine with the suv start the extra_rc. I used to have something like this back when I first started writing for Arma 2 where you had to steal certain vehicles from the enemy,  park them all in a marked trigger area, then have and npc with an addaction that would delete the stuff inside of the trigger and spawn a reward vehicle. You just need to write 

determine if required magazines are in players inventory that are needed for the transformation

determine if an unlocked suv is nearby

if both conditions are met removemagazines from the player, deletevehicle and createvehicle

There are quite a few ways to allow a player to initiate this script. 

Link to comment
Share on other sites

  • 0

create a trigger or npc to activate a script and change out weapons, parts, vehicle type and vehicle class for whatever you want. I haven't slept in 30 or so hours but this should give you an idea of what will do what you want it to. Just remember that _neededparts can't have more than one of the same thing or it will just check that player has one of them. This should find out if player has the right weapon equiped, the parts in their inventory and whether or not the closest vehicle of type suv, within 50m of player, is unlocked. If all that is good it will delete the gun, the parts, the suv and spawn an armored suv. Not making any promises but the below code sounds right in my head.

 

_weapons = weapons player;

_magazines = magazines player;

_hasgun=false;

_hasparts=false;

_hasvehicle=false;

if ("m249_EP1_DZ" in _weapons) then {

_hasgun=true;

};

 

_neededparts = ["Partengine", "partgeneric"];

_tmpparts= ["Partengine", "partgeneric"];

{

if (_magazines find _x > -1) then 

{

_neededparts=_neededparts-[_x];

};

 

} foreach _tmpparts;

if (count _neededparts==0) then {

_hasparts=true;

};

_nearestvehicles=nearestObjects [player,["SUV_Base_EP1",50];

_checkfirst = nearestvehicles select 0;

if(locked _checkfirst) then {

_hasvehicle=false;

} else {

_hasvehicle=true;

};

if(_hasparts && _hasgun) then {

if(_hasvehicle) then {

{

player removemagazine _x;

} foreach _tmpparts;

player removeweapon "m249_EP1_DZ";

_pos= getpos _checkfirst;

deletevehicle _checkfirst;

_armoredsuv = createVehicle ["ArmoredSUV_PMC_DZ", _pos, [], 0, "CAN_COLLIDE"];

PVDZE_obj_Publish = [dayz_characterID,_armoredsuv,[0,_pos],"ArmoredSUV_PMC_DZ"];
publicVariableServer "PVDZE_obj_Publish";

};

};

Link to comment
Share on other sites

  • 0

Hey man fantastic thanks for the reply ill test this out when I get home on the 22nd and let you all know how well it does and doesn't work! Appreciate all the support everyone of you guys and the community shows keep up the great work! Get some sleep man haha I know the feeling of 3 a dayers so I can feel your exhaustion haha. Again thanks a lot for teach na newbie like myself.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...