joe_candy Posted April 20, 2015 Report Share Posted April 20, 2015 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 More sharing options...
0 SchwEde Posted May 21, 2015 Report Share Posted May 21, 2015 ok, well still not really clue why the arrow appears 12m in the air. Are you not using: PARACHUTE_TARGET as a parking lot? Because i cant find it in the nearObjects array Have you tried to spawn a car on an open field with this script? Next thing we could do here is some dirty work, IF you want that the land vehicles spawn allways on the ground: add this: if (_vehicle select 0 isKindOf 'LandVehicle') then { _position = [_position select 0,_position select 1, 0.1]; }; under _position = getPosATL _nearestpad; This is a solution for this problem, but it is the dirty way and only if you want the landvehicles should spawn on the ground Link to comment Share on other sites More sharing options...
0 cen Posted May 21, 2015 Report Share Posted May 21, 2015 I moved the parking lot and it works fine now. So maybe it was an issue with the terrain? I dunno :D Gonna push this live and let players test it out now! Schwede/UKMartin you guys are awesome for not giving up on this. Link to comment Share on other sites More sharing options...
0 SchwEde Posted May 21, 2015 Report Share Posted May 21, 2015 good to hear that :) Link to comment Share on other sites More sharing options...
Question
joe_candy
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
original getvehicle.sqf
Link to comment
Share on other sites
Top Posters For This Question
37
27
27
3
Popular Days
May 21
33
May 18
26
May 19
19
May 20
14
Top Posters For This Question
SchwEde 37 posts
cen 27 posts
Buck0 27 posts
joe_candy 3 posts
Popular Days
May 21 2015
33 posts
May 18 2015
26 posts
May 19 2015
19 posts
May 20 2015
14 posts
Popular Posts
SchwEde
Can you Display what vehicle is? if it's an array ["VehicleName"] then try it with _vehicle select 0 isKindOf 'Air'
SchwEde
ok give some time, i will have a closer look on this then EDIT: Ok, i can only give guessings, because im not really able to test this, so you guys have to give me some ouput from this ^^ any
SchwEde
what about the changed server_spawnvehicle.sqf? any results with it? what about the output in the Rpt? ( search for "Schwede")
103 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now