Jump to content
Sign in to follow this  
HonzaVinCZ

Keep vehicle init after respawn

Recommended Posts

Hello, I'd like to ask you for help with this thing. I use Light Vehicle Respawn Script and I don't know how to keep vehicle name and init after respawn. I tried its functions but unsuccessfully. It doesn't save the vehicle name and it shows error on vehicle respawn if I use following:
functions.sqf:

/* Register new vehicle init functions here - (see hunterInit below and fn_hunterInit.sqf) */

class LVR
{
    class vehInitFncs
    {
        file = "LVR\functions";
		class vehRespawn      	  {}; //main respawn function - Do Not Delete
		class OHQ          {}; // Example - Can Be Deleted
    };
};  

fn_OHQ.sqf:

/* Example Vehicle Init - Can Be deleted */

_this = [this, 1000, east, "LIGHT"] execVM 
"R3F_LOG\USER_FUNCT\init_creation_factory.sqf";
_this = [ this, 120, 60, LVR_fnc_OHQ ] spawn LVR_fnc_vehRespawn;

And this is my teleport script:

_dest = (_this select 3) select 0;

if (alive _dest && west countSide (getPos _dest nearEntities 300) ==0) then {
	_dir = random 359;
	_spot =  getPosATL _dest;
	cutText ["","BLACK OUT",4];
	[parseText "<t font='PuristaBold' size='1.6'>Moving in progress...</t><br />Hold on soldier", true, nil, 4, 0.7, 0] spawn BIS_fnc_textTiles;
	sleep 5;
	player setDir _dir;
	player SetPosATL (_spot vectorAdd [10 - random 10, 10 - random 10,0]);
	cutText ["","BLACK IN",2];

} else {
	[parseText "<t font='PuristaBold' size='1.6'>HQ is unavaible</t>", true, nil, 3, 0.7, 0] spawn BIS_fnc_textTiles;
};

OHQ1 vehicle init:
_this = [this, 1000, east, "LIGHT"] execVM 
"R3F_LOG\USER_FUNCT\init_creation_factory.sqf";
_this = [ this, 120, 60, LVR_fnc_OHQ ] spawn LVR_fnc_vehRespawn;

It shows some error on OHQ1 respawn. It respawns successfully but name and init of that vehicle is lost. Is there any other way how to make it save the name and init please? I'm not very friendly with editor respawn module because it respawns vehicles by very weird way and it keeps crashing vehicles to each others when they respawn. 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×