SmokeyMeadow
Well-Known Member
I've been working on a script to let players fix up certain wrecked cars seen around the map, specifically the white Lada wreck. It's always looked drivable, and has tricked my friends and I more than a few times.
Using this script, players can salvage the Lada for use as a temporary vehicle. It will revert back to a wreck form in its original position after reset. This script uses a line of code from Dayz of Glory, to spawn a Lada in place of the wreck. I had to borrow it, because usually when I place non-database vehicles on the map, they explode. Not the case with this script, and I would love to know why.
This portion goes at the end of fn_selfactions.sqf:
Then this is Lada.sqf:
There are a few things I would like to do with this, but I'm not skilled enough. One would be to make the fixed Lada spawn with heavy damage, and also to make it spawn in the exact place of the wreck. Anyone with ideas on how to do that is welcomed to share.
Using this script, players can salvage the Lada for use as a temporary vehicle. It will revert back to a wreck form in its original position after reset. This script uses a line of code from Dayz of Glory, to spawn a Lada in place of the wreck. I had to borrow it, because usually when I place non-database vehicles on the map, they explode. Not the case with this script, and I would love to know why.
This portion goes at the end of fn_selfactions.sqf:
Code:
//LADA FIX END
if(cursorTarget isKindOf "LADAWreck" && _canDo && (player distance cursorTarget < 5) && ("PartEngine" in magazines player) && ("PartGeneric" in magazines player) && ("ItemToolbox" in items player)) then {
nearLada = true;
} else {
nearLada = false;
};
if (nearLada) then {
if (s_player_lada < 0) then {
s_player_lada = player addAction [("<t color=""#0096ff"">" + ("Repair Lada") +"</t>"),"scripts\lada.sqf","",5,false,true,"",""];
};
} else {
player removeAction s_player_lada;
s_player_lada = -1;
};
//LADA FIX END
Then this is Lada.sqf:
Code:
private ["_createLada", "_dis", "_sfx"];
titleText ["This car can be salvaged.","PLAIN DOWN"]; titleFadeOut 5;
sleep 1;
_dis = 20;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
player playActionNow "Medic";
spawnthisshit = getposATL _createLada;
_createLada = nearestObject [player, "LADAWreck"];
sleep 1;
player removeMagazine "PartGeneric";
player removeMagazine "PartEngine";
sleep 0.01;
titleText ["You have salvaged the Lada.","PLAIN DOWN"]; titleFadeOut 5;
sleep 1;
deleteVehicle _createLada;
spawnthisshit = "Lada1";call vehicle_spawner;
There are a few things I would like to do with this, but I'm not skilled enough. One would be to make the fixed Lada spawn with heavy damage, and also to make it spawn in the exact place of the wreck. Anyone with ideas on how to do that is welcomed to share.