Jump to content
  • 0

[Fixed] Virtual Garage - spawnpoints for different Vehicle


joe_candy

Question

Hey, i can't find my error, so i hope you could help me...

 

I try to use two different spawnpoints for Air and Land vehicle with two different "helipads".

 

"HeliHCivil" -> air vehicle

"Sr_border" -> land vehicle

 

i try some different codes at the "getvehicle.sqf" but nothing works.

RPT don't log some errors, so i don't know where i could find my error.

 

Try this code

//Get Spawn Location
_dir = round(random 360);
_helipad = nearestObjects [player, ["HeliH","HeliHCivil","HeliHRescue","MAP_Heli_H_army"], 70];
_vgcarspawn = nearestObjects [player, ["MAP_Heli_H_cross","Sr_border"], 70];
if((count _helipad == 0) && (_vehicleClass == "Air")) exitWith {cutText ["You need a helipad to spawn air vehicles", "PLAIN DOWN"];};
if((count _vgcarspawn == 0) && (_vehicleClass == "Land")) exitWith {cutText ["You need a carpad to spawn land vehicles", "PLAIN DOWN"];};
if((count _helipad > 0) && (_vehicleClass == "Air")) then {
	_location = (getPosATL (_helipad select 0));
	} else {
		if((count _vgcarspawn > 0) && (_vehicleClass == "Land")) then {
		_location = (getPosATL (_vgcarspawn select 0));
	} else {
		_location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
	};};

 

original getvehicle.sqf

// Developed by [GZA] David for German Zombie Apocalypse Servers (https://zombieapo.eu/)
private["_vehicle","_vehicleClass","_dir","_helipad","_location","_veh","_location","_veh","_result","_id","_inventory","_backpack","_fuel","_damage","_id"];
if(lbCurSel 2802 == -1) exitWith {hint  "No Vehicle selected"};
closeDialog 0;
_vehicle = lbData[2802,(lbCurSel 2802)];
_vehicle = (call compile format["%1",_vehicle]);
_vehicleClass = getText(configFile >> "CfgVehicles" >> (_vehicle select 1) >> "vehicleClass");



//Get Spawn Location
_dir = round(random 360);
_helipad = nearestObjects [player, ["HeliH","HeliHCivil","HeliHRescue","MAP_Heli_H_army","MAP_Heli_H_cross","Sr_border"], 70];
if((count _helipad == 0) && (_vehicleClass == "Air")) exitWith {cutText ["You need a helipad to spawn air vehicles", "PLAIN DOWN"];};
if(count _helipad > 0) then {
_location = (getPosATL (_helipad select 0));
} else {
_location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
};

_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];


PVDZE_spawnVehicle = [_veh, [_dir,_location], player,  (_vehicle select 0)]; // _vehicle select 0 = id
publicVariableServer "PVDZE_spawnVehicle";

waitUntil {!isNil "PVDZE_spawnVehicleResult"};

if(PVDZE_spawnVehicleResult != "0") then {
			_result = "0";
			_id = parsenumber PVDZE_spawnVehicleResult;
			if ((_id > 0) && (_id <= 2500)) then {_result = format["ItemKeyGreen%1",_id];};
			if ((_id > 2500) && (_id <= 5000)) then {_result = format["ItemKeyRed%1",_id-2500];};
			if ((_id > 5000) && (_id <= 7500)) then {_result = format["ItemKeyBlue%1",_id-5000];};
			if ((_id > 7500) && (_id <= 10000)) then {_result = format["ItemKeyYellow%1",_id-7500];};
			if ((_id > 10000) && (_id <= 12500)) then {_result = format["ItemKeyBlack%1",_id-10000];};
			
			_inventory = (weapons player);
			_backpack = ((getWeaponCargo unitBackpack player) select 0);
			if (_result in (_inventory+_backpack)) then
			{
				if (_result in _inventory) then {cutText [format["Key [%1] already in your inventory!",_result], "PLAIN"];};
				if (_result in _backpack) then {cutText [format["Key [%1] already in your backpack!",_result], "PLAIN"];};
			}
			else
			{
				player addweapon _result;
				cutText [format["Key [%1] added to your inventory!",_result], "PLAIN"];
				
			};
};

PVDZE_spawnVehicleResult = nil;
PVDZE_queryGarageVehicleResult = nil;
sleep 2;
cutText ["Spawned Vehicle.", "PLAIN DOWN"];

Link to comment
Share on other sites

Recommended Posts

  • 0

so this is something weird here:

 

every one of them is spawned with the same code, but they get a little plus on the Z the further they are from the ground

_position = getPosATL player;
_position = [_position select 0, _position select 1, _position select 2];
_sign = createVehicle ["Sign_arrow_down_large_EP1",_position,[],0,"CAN_COLLIDE"];

b3w6wqsw.png

 

Will see if i can get a workaround there :)

 

EDIT:

 

Ok got it :)

Thanks to Martin here, that was the solution:

_nearestpad = _helipadsnear select 0;
_position = getPosATL _nearestpad;
_position = [_location select 0, _location select 1, _location select 2 + 0.2];

_checkkey = [player,_key] call BIS_fnc_invAdd;
if (!(_checkkey)) exitWith {cutText [(localize "str_epoch_player_107"),"PLAIN DOWN"]};

_sign = createVehicle ["Sign_arrow_down_large_EP1",_position,[],0,"CAN_COLLIDE"];
_sign setPos _position; 

This should do the trick ^^

 

the server_spawnvehicle.sqf can be untouched again :)

Link to comment
Share on other sites

  • 0

Doesn't work for me. Vehicle doesn't get DB coords.

AXdDXPr.png

 

Code I'm using:

 

/*** Created by 0verHeaT ***/


private ["_Missing","_index","_SpawnPats","_helipadsnear","_nearestpad","_veh","_vehicle","_key","_vehname","_position","_checkkey","_sign"];
_index = _this select 0;
if (_index < 0) exitWith {cutText["\n\nNo Vehicle selected!","PLAIN DOWN"]};

_veh = VehStoredList select _index;
_vehicle = _veh select 0;
_key = _veh select 1;
_Missing = "";
_vehname = getText(configFile >> "cfgVehicles" >> (_vehicle select 0) >> "displayName");

if (_vehicle select 0 isKindOf 'Air') then {
_SpawnPats = ["Sr_border"];
_Missing = "Helipad";
} else {
_SpawnPats = ["PARACHUTE_TARGET"];
_Missing = "Parking Lot";
};

_helipadsnear = nearestObjects [(getPosATL player),_SpawnPats,50];
if ((count _helipadsnear) < 1) exitWith {cutText["\n\nYou need a "+_Missing+"! Right click on your Toolbox to build one!","PLAIN DOWN"]};

_nearestpad = _helipadsnear select 0;
_position = getPosATL _nearestpad;
_position = [_location select 0, _location select 1, _location select 2 + 0.2];

_checkkey = [player,_key] call BIS_fnc_invAdd;
if (!(_checkkey)) exitWith {cutText [(localize "str_epoch_player_107"),"PLAIN DOWN"]};

_sign = createVehicle ["Sign_arrow_down_large_EP1",_position,[],0,"CAN_COLLIDE"];
_sign setPos _position;

PVDZE_veh_spawn = [player,_vehicle,_sign,VirtualGarage];
publicVariableServer "PVDZE_veh_spawn";

cutText [format["\n\nYou have successfully spawned a %1, %2 has been added to your toolbelt.",_vehname,getText(configFile >> "CfgWeapons" >> _key >> "displayName")],"PLAIN DOWN"];

sleep 2;
call garage_getnearVeh;
call garage_getstoredVeh;

Link to comment
Share on other sites

  • 0

Got it!

 

Code:

/*** Created by 0verHeaT ***/


private ["_Missing","_index","_SpawnPats","_helipadsnear","_nearestpad","_veh","_vehicle","_key","_vehname","_position","_checkkey","_sign"];
_index = _this select 0;
if (_index < 0) exitWith {cutText["\n\nNo Vehicle selected!","PLAIN DOWN"]};

_veh = VehStoredList select _index;
_vehicle = _veh select 0;
_key = _veh select 1;
_Missing = "";
_vehname = getText(configFile >> "cfgVehicles" >> (_vehicle select 0) >> "displayName");

if (_vehicle select 0 isKindOf 'Air') then {
_SpawnPats = ["Sr_border"];
_Missing = "Helipad";
} else {
_SpawnPats = ["PARACHUTE_TARGET"];
_Missing = "Parking Lot";
};

_helipadsnear = nearestObjects [(getPosATL player),_SpawnPats,50];
if ((count _helipadsnear) < 1) exitWith {cutText["\n\nYou need a "+_Missing+"! Right click on your Toolbox to build one!","PLAIN DOWN"]};

_nearestpad = _helipadsnear select 0;
_position = getPosATL _nearestpad;

_checkkey = [player,_key] call BIS_fnc_invAdd;
if (!(_checkkey)) exitWith {cutText [(localize "str_epoch_player_107"),"PLAIN DOWN"]};

_sign = createVehicle ["Sign_arrow_down_large_EP1",_position,[],0,"CAN_COLLIDE"];
_sign setPos _position;

PVDZE_veh_spawn = [player,_vehicle,_sign,VirtualGarage];
publicVariableServer "PVDZE_veh_spawn";

cutText [format["\n\nYou have successfully spawned a %1, %2 has been added to your toolbelt.",_vehname,getText(configFile >> "CfgWeapons" >> _key >> "displayName")],"PLAIN DOWN"];

sleep 2;
call garage_getnearVeh;
call garage_getstoredVeh;

 

EDIT: I lied.

 

First one (very top) spawned fine, and the other two... well... as you can see:

 

RSKd6JP.jpg

Link to comment
Share on other sites

  • 0

kk, so applied all fixes, didnt work, instead of spawning in vehicles near the "marker" it spawned them bottom left corner

 

edit, left your debug in, 

 

19:45:05 "[schwedes-Debug] Object getPos: [0.000717865,-0.204312,0.600182] | getPosASL: [0.000717865,-0.204312,0]"

 

 

QOIA1EA.jpg

Link to comment
Share on other sites

  • 0

a bit more details would be nice ;)

RPT?

Could you see the arrow?

Have you checked if the Heli is might somewhere else?

 

I tested the code in simple version:

_pos = getPosATL player;
_dir = getdir player;
_position = [(_pos select 0)+5*sin(_dir),(_pos select 1)+5*cos(_dir),(_pos select 2)];;
_sign = createVehicle ["Sign_arrow_down_large_EP1",_position,[],0,"CAN_COLLIDE"];
_sign setPos _position;

_location = getPosATL _sign;

_object = createVehicle ["Mi17_DZE",_location,[],0,"CAN_COLLIDE"];
_object setPos _location;

Result:

gzjczh5f.png

Link to comment
Share on other sites

  • 0

ok, so after some further testing, we are almost done

 

the arrow now spawns @ the correct position EXACTLY where it needs to, however the vehicle spawns about 10m above and falls.....

 

most of the time it lands ok, about 3/10 it falls on an odd angle and blows up

 

edit: this is using your two most recent posted files

Link to comment
Share on other sites

  • 0

so under this line:

_object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"];

you have this?

_object setpos _location;

Also can you also add the debug lines back in the server_spawnVehicle.sqf

this under

diag_log format ["[Schwedes-Debug] Object getPos: %1 | getPosASL: %2",(getPosASL _object), (getPos _object)];
_object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"];

this line

diag_log format ["[Schwedes-Debug] Object getPosASL after setpos: %1",(getPosASL _object)];

under this line 

_object setpos _location;

so we check the position before and after setpos :)

 

and at the top after this:

_location = getPosATL _arrow;

this line

diag_log format ["[Schwedes-Debug] _location: %1 | getPos _arrow: %2",_location, (getPos _arrow)];

I will not give up on this ^^ 

It will be finished until you guys up or its working like it should :D

Link to comment
Share on other sites

  • 0

I have 2 heli pads on different levels and a "parking lot" on the ground.
 
Top heli pad spawns fine, lower one shows arrow correct, but spawns heli 10-15m in the air.
 
Parking lot spawns arrow and vehicle 20-30m in the air.
 
Also I changed this line in your code because it wouldn't even spawn the vehicle for me:
 
Yours:

if (_vehicle  isKindOf 'Air') then {

UK's:

if (_vehicle select 0 isKindOf 'Air') then {
	Line 550: 23:06:56 "[Schwedes-Debug] _location: [4033.52,6920.33,13.4354] | getPos _arrow: [4033.52,6920.33,-0.0299683]"
	Line 555: 23:06:57 "[Schwedes-Debug] Object getPos: [4033.68,6920.41,318.574] | getPosASL: [4033.68,6920.41,-0.0343628]"
	Line 556: 23:06:57 "[Schwedes-Debug] Object getPosASL after setpos: [4033.84,6920.48,318.561]"
	Line 557: 23:07:31 "[Schwedes-Debug] _location: [4026.6,6905.18,12.4053] | getPos _arrow: [4026.6,6905.18,12.4053]"
	Line 563: 23:07:32 "[Schwedes-Debug] Object getPos: [4026.68,6905.22,318.603] | getPosASL: [4026.68,6905.22,12.4196]"
	Line 564: 23:07:32 "[Schwedes-Debug] Object getPosASL after setpos: [4026.76,6905.25,318.596]"
	Line 565: 23:07:38 "[Schwedes-Debug] _location: [4041.47,6902.82,12.1422] | getPos _arrow: [4041.47,6902.82,6.08643]"
	Line 570: 23:07:39 "[Schwedes-Debug] Object getPos: [4041.47,6902.82,323.268] | getPosASL: [4041.47,6902.82,12.1424]"
	Line 571: 23:07:39 "[Schwedes-Debug] Object getPosASL after setpos: [4041.81,6902.94,317.198]"
	Line 578: 23:08:28 "[Schwedes-Debug] _location: [4026.6,6905.18,12.4053] | getPos _arrow: [4026.6,6905.18,12.4053]"
	Line 583: 23:08:29 "[Schwedes-Debug] Object getPos: [4026.68,6905.22,318.603] | getPosASL: [4026.68,6905.22,12.4196]"
	Line 584: 23:08:29 "[Schwedes-Debug] Object getPosASL after setpos: [4026.76,6905.25,318.596]"
	Line 585: 23:08:45 "[Schwedes-Debug] _location: [4033.52,6920.33,13.4354] | getPos _arrow: [4033.52,6920.33,-0.0299683]"
	Line 590: 23:08:46 "[Schwedes-Debug] Object getPos: [4033.67,6920.4,318.574] | getPosASL: [4033.67,6920.4,-0.033844]"
	Line 591: 23:08:46 "[Schwedes-Debug] Object getPosASL after setpos: [4033.82,6920.47,318.562]"
	Line 597: 23:09:15 "[Schwedes-Debug] _location: [4026.6,6905.18,12.4053] | getPos _arrow: [4026.6,6905.18,12.4053]"
	Line 602: 23:09:16 "[Schwedes-Debug] Object getPos: [4026.68,6905.22,318.603] | getPosASL: [4026.68,6905.22,12.4196]"
	Line 603: 23:09:16 "[Schwedes-Debug] Object getPosASL after setpos: [4026.76,6905.25,318.596]"
	Line 606: 23:09:29 "[Schwedes-Debug] _location: [4026.6,6905.18,12.4053] | getPos _arrow: [4026.6,6905.18,12.4053]"
	Line 611: 23:09:30 "[Schwedes-Debug] Object getPos: [4026.68,6905.22,318.603] | getPosASL: [4026.68,6905.22,12.4196]"
	Line 612: 23:09:30 "[Schwedes-Debug] Object getPosASL after setpos: [4026.76,6905.25,318.596]"
	Line 615: 23:09:45 "[Schwedes-Debug] _location: [4026.6,6905.18,12.4053] | getPos _arrow: [4026.6,6905.18,12.4053]"
	Line 620: 23:09:46 "[Schwedes-Debug] Object getPos: [4026.68,6905.22,318.603] | getPosASL: [4026.68,6905.22,12.4196]"
	Line 621: 23:09:46 "[Schwedes-Debug] Object getPosASL after setpos: [4026.76,6905.25,318.596]"
	Line 628: 23:10:01 "[Schwedes-Debug] _location: [4033.52,6920.33,13.4354] | getPos _arrow: [4033.52,6920.33,-0.0299683]"
	Line 633: 23:10:02 "[Schwedes-Debug] Object getPos: [4033.68,6920.41,318.574] | getPosASL: [4033.68,6920.41,-0.0343628]"
	Line 634: 23:10:02 "[Schwedes-Debug] Object getPosASL after setpos: [4033.84,6920.48,318.561]"
	Line 635: 23:10:04 "[Schwedes-Debug] _location: [4033.52,6920.33,13.4354] | getPos _arrow: [4033.52,6920.33,-0.0299683]"
	Line 640: 23:10:05 "[Schwedes-Debug] Object getPos: [4033.67,6920.4,318.574] | getPosASL: [4033.67,6920.4,-0.033844]"
	Line 641: 23:10:05 "[Schwedes-Debug] Object getPosASL after setpos: [4033.82,6920.47,318.562]"
	Line 648: 23:10:36 "[Schwedes-Debug] _location: [4041.47,6902.82,12.1422] | getPos _arrow: [4041.47,6902.82,6.08643]"
	Line 653: 23:10:37 "[Schwedes-Debug] Object getPos: [4041.47,6902.82,323.268] | getPosASL: [4041.47,6902.82,12.1422]"
	Line 654: 23:10:37 "[Schwedes-Debug] Object getPosASL after setpos: [4041.83,6902.95,317.197]"

vNVNVyW.jpgOlo9zvv.jpg

Link to comment
Share on other sites

  • 0

Thanks. Try resetting the Position, after the Vehicle get's initialized, like so:

 

private ["_player","_vehicledata","_arrow","_key","_garage","_class","_cid","_colour1","_inventory","_fuel","_damage","_hitpoints","_location","_dir","_worldspace","_uid","_vehiclelist","_newlist"];
_player = _this select 0;
_vehicledata = _this select 1;
_arrow = _this select 2;
_garage = _this select 3;

_class = _vehicledata select 0;
_cid = str(_vehicledata select 1);
_colour1 = _vehicledata select 2;
_colour2 = _vehicledata select 3;
_inventory = _vehicledata select 4;
_fuel = _vehicledata select 5;
_damage = _vehicledata select 6;
_hitpoints = _vehicledata select 7;

_location = getPosATL _arrow;
diag_log format ["[Schwedes-Debug] _location: %1 | getPos _arrow: %2",_location, (getPos _arrow)];
_dir = getDir _garage;
_worldspace = [_dir,_location];

_uid = _worldspace call dayz_objectUID3;
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _cid, _worldspace, [], [], 1,_uid];
diag_log ("HIVE: WRITE: "+ str(_key)); 
_key call server_hiveWrite;

[_arrow,_uid,_cid,_class,_dir,_location,_player,_colour1,_colour2,_inventory,_fuel,_damage,_hitpoints] spawn {
	private ["_object","_uid","_characterID","_done","_retry","_key","_result","_outcome","_oid","_class","_location","_object_para","_activatingPlayer","_colour1","_colour2","_inventory","_fuel","_damage","_hitpoints","_clrinit","_clrinit2","_objWpnTypes","_objWpnQty","_countr"];
	_object = _this select 0;
	_uid = _this select 1;
	_characterID = _this select 2;
	_class = _this select 3;
	_dir = _this select 4;
	_location = _this select 5;
	_activatingPlayer = _this select 6;
	_colour1 = _this select 7;
	_colour2 = _this select 8;
	_inventory = _this select 9;
	_fuel = _this select 10;
	_damage = _this select 11;
	_hitpoints = _this select 12;

   _done = false;
	_retry = 0;
	while {_retry < 10} do {
		sleep 1;
		_key = format["CHILD:388:%1:",_uid];
		diag_log ("HIVE: WRITE: "+ str(_key));
		_result = _key call server_hiveReadWrite;
		_outcome = _result select 0;
		if (_outcome == "PASS") then {
			_oid = _result select 1;
			diag_log("CUSTOM: Selected " + str(_oid));
			_done = true;
			_retry = 100;
		} else {
			diag_log("CUSTOM: trying again to get id for: " + str(_uid));
			_done = false;
			_retry = _retry + 1;
		};
	};
	deleteVehicle _object;

	if(!_done) exitWith { diag_log("CUSTOM: failed to get id for : " + str(_uid)); };

	_object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"];
	diag_log format ["[Schwedes-Debug] Object getPos: %1 | getPosASL: %2",(getPosASL _object), (getPos _object)];
	diag_log format ["[Schwedes-Debug] Object getPosASL after setpos: %1",(getPosASL _object)];
	_object setDir _dir;
	_object setvehiclelock "locked";

	clearWeaponCargoGlobal  _object;
	clearMagazineCargoGlobal  _object;

	_object setVariable ["ObjectID", _oid, true];
	_object setVariable ["lastUpdate",time];
	_object setVariable ["CharacterID",_characterID, true];
	
	if (_colour1 != "0") then {
		_object setVariable ["Colour",_colour1,true];
		_clrinit = format ["#(argb,8,8,3)color(%1)",_colour1];
		_object setVehicleInit "this setObjectTexture [0,"+str _clrinit+"];";
	};
	if (_colour2 != "0") then {			
		_object setVariable ["Colour2",_colour2,true];
		_clrinit2 = format ["#(argb,8,8,3)color(%1)",_colour2];
		_object setVehicleInit "this setObjectTexture [1,"+str _clrinit2+"];";
	};

	_objWpnTypes = (_inventory select 0) select 0;
	_objWpnQty = (_inventory select 0) select 1;
	_countr = 0;					
	{
		if(_x in (DZE_REPLACE_WEAPONS select 0)) then {
			_x = (DZE_REPLACE_WEAPONS select 1) select ((DZE_REPLACE_WEAPONS select 0) find _x);
		};
		_object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
		_countr = _countr + 1;
	} count _objWpnTypes; 

	_objWpnTypes = (_inventory select 1) select 0;
	_objWpnQty = (_inventory select 1) select 1;
	_countr = 0;
	{
		if (_x == "BoltSteel") then { _x = "WoodenArrow" };
		if (_x == "ItemTent") then { _x = "ItemTentOld" };
		_object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
		_countr = _countr + 1;
	} count _objWpnTypes;

	_objWpnTypes = (_inventory select 2) select 0;
	_objWpnQty = (_inventory select 2) select 1;
	_countr = 0;
	{
		_object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
		_countr = _countr + 1;
	} count _objWpnTypes;

	_object setFuel _fuel;
	_object setDamage _damage;

	{
		private ["_selection","_dam"];
		_selection = _x select 0;
		_dam = _x select 1;
		if (_selection in dayZ_explosiveParts && _dam > 0.8) then {_dam = 0.8};
		[_object,_selection,_dam] call object_setFixServer;
	} forEach _hitpoints;

	PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object];
	_object call fnc_veh_ResetEH;
	PVDZE_veh_Init = _object;
	publicVariable "PVDZE_veh_Init";

	_object setpos _location;
};

_vehiclelist = _garage getVariable ["StoredVehicles",[]];

_newlist = [];
{
	private ["_data","_toremove"];
	_toremove = false;
	if ((_x select 1) == _cid) then { _toremove = true; };
	if (!_toremove) then {
		_data = [(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6),(_x select 7)];
		_newlist set [count _newlist,_data];
	};
} count _vehiclelist;

_garage setVariable ["StoredVehicles",_newlist,true];

diag_log format["VIRTUAL GARAGE: Player %1 (%2) has spawned a %3 | "+str _newlist+"",(name _player),(getPlayerUID _player),_class];

[_garage,"gear",_newlist] spawn server_updateObject;

and the same for the Sign:

 

/*** Created by 0verHeaT ***/
private ["_Missing","_index","_SpawnPats","_helipadsnear","_nearestpad","_veh","_vehicle","_key","_vehname","_position","_checkkey","_sign"];
_index = _this select 0;
if (_index < 0) exitWith {cutText["\n\nNo Vehicle selected!","PLAIN DOWN"]};

_veh = VehStoredList select _index;
_vehicle = _veh select 0;
_key = _veh select 1;
_Missing = "";
_vehname = getText(configFile >> "cfgVehicles" >> (_vehicle select 0) >> "displayName");

if (_vehicle select 0 isKindOf 'Air') then {
_SpawnPats = ["Sr_border"];
_Missing = "Helipad";
} else {
_SpawnPats = ["PARACHUTE_TARGET"];
_Missing = "Parking Lot";
};

_helipadsnear = nearestObjects [(getPosATL player),_SpawnPats,50];
if ((count _helipadsnear) < 1) exitWith {cutText["\n\nYou need a "+_Missing+"! Right click on your Toolbox to build one!","PLAIN DOWN"]};

_nearestpad = _helipadsnear select 0;
_position = getPosATL _nearestpad;

_checkkey = [player,_key] call BIS_fnc_invAdd;
if (!(_checkkey)) exitWith {cutText [(localize "str_epoch_player_107"),"PLAIN DOWN"]};

_sign = createVehicle ["Sign_arrow_down_large_EP1",_position,[],0,"CAN_COLLIDE"];

PVDZE_veh_spawn = [player,_vehicle,_sign,VirtualGarage];
publicVariableServer "PVDZE_veh_spawn";

_sign setPos _position;

cutText [format["\n\nYou have successfully spawned a %1, %2 has been added to your toolbelt.",_vehname,getText(configFile >> "CfgWeapons" >> _key >> "displayName")],"PLAIN DOWN"];

sleep 2;
call garage_getnearVeh;
call garage_getstoredVeh;
Link to comment
Share on other sites

  • 0

:wacko:  :unsure:

Did used the wrong code for the debugging:

 

should be

getPosATL

instead of

getPosASL

Will get some sleep and try something else tomorrow  :huh:

 

 

EDIT:

 

also try to replace 

setPos

with 

setPosATL

in both files.

Dont know if this will make any changes, but at least we tried ^^

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
×
×
  • Create New...