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 April 20, 2015 Report Share Posted April 20, 2015 try instead of (_vehicleClass == "Air")) _vehicle isKindOf "Air" Link to comment Share on other sites More sharing options...
0 joe_candy Posted April 21, 2015 Author Report Share Posted April 21, 2015 hmm... now i tryed 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) && (_vehicle isKindOf "Air")) exitWith {cutText ["You need a helipad to spawn air vehicles", "PLAIN DOWN"];}; if((count _vgcarspawn == 0) && (_vehicle isKindOf "Land")) exitWith {cutText ["You need a carpad to spawn land vehicles", "PLAIN DOWN"];}; if((count _helipad > 0) && (_vehicle isKindOf "Air")) then { _location = (getPosATL (_helipad select 0)); } else { if((count _vgcarspawn > 0)&& (_vehicle isKindOf "Land")) then { _location = (getPosATL (_vgcarspawn select 0)); } else { _location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos; }; }; but same problem. if i called a car from garage, it doesn't spawn anything.... RPT log is clear... :( next time i try with "_vehicleclass isKindOf"... some more ideas? Link to comment Share on other sites More sharing options...
0 SchwEde Posted April 21, 2015 Report Share Posted April 21, 2015 have you _vehicle defined somewhere? this was just an example. you will need the vehicle which is choosed to pulled out of the garage and check this for if isKindof "Whatever". Link to comment Share on other sites More sharing options...
0 joe_candy Posted April 21, 2015 Author Report Share Posted April 21, 2015 at the top of the "getvehicle.sqf" is _vehicle difined. _vehicle = lbData[2802,(lbCurSel 2802)]; _vehicle = (call compile format["%1",_vehicle]); _vehicleClass = getText(configFile >> "CfgVehicles" >> (_vehicle select 1) >> "vehicleClass"); i do not get it.On my first attempt, the query code works with the helipad, but the query with the carpad not work. Although I have used the same variable. As if the "carpad" is ignored and thereby generates an error. *Edit* Now everything works fine.... changed _vehicle to _vehicleclass and modify the player position. //Get Spawn Location _dir = round(random 360); _vgposplayer = getPos player; _helipad = nearestObjects [_vgposplayer, ["HeliH","HeliHCivil","HeliHRescue","MAP_Heli_H_army"], 70]; _vgcarspawn = nearestObjects [_vgposplayer, ["MAP_Heli_H_cross","Sr_border"], 70]; if((count _helipad == 0) && (_vehicleclass isKindOf "Air")) exitWith {cutText ["You need a helipad to spawn air vehicles", "PLAIN DOWN"];}; if((count _vgcarspawn == 0) && (_vehicleclass isKindOf "Land")) exitWith {cutText ["You need a carpad to spawn land vehicles", "PLAIN DOWN"];}; if((count _helipad > 0) && (_vehicleclass isKindOf "Air")) then { _location = (getPosATL (_helipad select 0)); } else { if((count _vgcarspawn > 0)&& (_vehicleclass isKindOf "Land")) then { _location = (getPosATL (_vgcarspawn select 0)); } else { _location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos; }; }; thanks for your help Link to comment Share on other sites More sharing options...
0 Buck0 Posted May 17, 2015 Report Share Posted May 17, 2015 does anyone have something like this for 0verheats version? Link to comment Share on other sites More sharing options...
0 cen Posted May 17, 2015 Report Share Posted May 17, 2015 Anyone able to spawn the helipad in the air and get the vehicles to spawn there? Think raised heli storage on a base. Link to comment Share on other sites More sharing options...
0 Buck0 Posted May 17, 2015 Report Share Posted May 17, 2015 I see we are after the same thing cen Link to comment Share on other sites More sharing options...
0 cen Posted May 17, 2015 Report Share Posted May 17, 2015 Yea I tried to use a different object other than heli pad, but when I place the object in the air, the vehicle spawns above it like 30m in the air lol Link to comment Share on other sites More sharing options...
0 Guest Posted May 17, 2015 Report Share Posted May 17, 2015 Helipads are somewhat street like. They stay on the Groud, allways. The solution here is to use other Objects and then just play around with the positioning. Link to comment Share on other sites More sharing options...
0 cen Posted May 17, 2015 Report Share Posted May 17, 2015 I can use another object as a spawn "marker" for the vehicle, but I can't find what is choosing the position of the vehicle in the code. Here's the spawn vehicle code: /*** Created by 0verHeaT ***/ private ["_index","_helipads","_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; _vehname = getText(configFile >> "cfgVehicles" >> (_vehicle select 0) >> "displayName"); _helipads = ["HeliH","HeliHCivil","HeliHRescue","MAP_Heli_H_army","MAP_Heli_H_cross"]; _helipadsnear = nearestObjects [(getPosATL player),_helipads,50]; if ((count _helipadsnear) < 1) exitWith {cutText["\n\nYou need a Helipad! 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"; 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 More sharing options...
0 Buck0 Posted May 18, 2015 Report Share Posted May 18, 2015 Yeah i had a look, couldn't figure it out tho Link to comment Share on other sites More sharing options...
0 SchwEde Posted May 18, 2015 Report Share Posted May 18, 2015 It is choosing one of the nearest objects defined in this array ["HeliH","HeliHCivil","HeliHRescue","MAP_Heli_H_army","MAP_Heli_H_cross"]; You can add more objects to this array which also can be chosen as a position for the vehicle Link to comment Share on other sites More sharing options...
0 Buck0 Posted May 18, 2015 Report Share Posted May 18, 2015 Yeah, except we want to limit air vehicles to a specific object and land vehicles to a specific object. I cant see an easy way of doing it without rewriting the whole spawnvehicle.sqf Link to comment Share on other sites More sharing options...
0 SchwEde Posted May 18, 2015 Report Share Posted May 18, 2015 I will write a quick script for that as soon as I get home. But if you guys already want do it yourself try it with a check for LandVehicle or "isKindOf 'Air'" EDIT: Not Tested! /*** 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 isKindOf 'Air') then { _SpawnPats = ["HeliH","HeliHCivil","HeliHRescue","MAP_Heli_H_army"]; _Missing = "Helipad"; } else { _SpawnPats = ["MAP_Heli_H_cross","Sr_border","MayAddMoreObejctsInHere"]; _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"; 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 More sharing options...
0 Buck0 Posted May 18, 2015 Report Share Posted May 18, 2015 doesnt work, client rpt if (_vehicle isKindOf 'Air') then { _SpawnPats = ["He> Error position: <isKindOf 'Air') then { _SpawnPats = ["He> Error iskindof: Type Array, expected String,Object File mpmissions\__CUR_MP.chernarus\scripts\Garage\garage_spawnvehicle.sqf, line 12 Link to comment Share on other sites More sharing options...
0 SchwEde Posted May 18, 2015 Report Share Posted May 18, 2015 Can you Display what vehicle is? if it's an array ["VehicleName"] then try it with _vehicle select 0 isKindOf 'Air' Buck0 1 Link to comment Share on other sites More sharing options...
0 Buck0 Posted May 18, 2015 Report Share Posted May 18, 2015 perfect Link to comment Share on other sites More sharing options...
0 cen Posted May 18, 2015 Report Share Posted May 18, 2015 But can you place an object in the air so that the vehicle will spawn there. Like the 2nd story or roof of a base. Link to comment Share on other sites More sharing options...
0 Buck0 Posted May 18, 2015 Report Share Posted May 18, 2015 yeah, i see what you mean, can place the pad on the top level, it literally spawns 15m above it hangs there till takes dmg, falls to ground and blows up need to adjust the re spawn hight above item, seems to be to much Link to comment Share on other sites More sharing options...
0 cen Posted May 18, 2015 Report Share Posted May 18, 2015 Exactly! I can't seem to find where it is choosing the spawn height. Link to comment Share on other sites More sharing options...
0 Guest Posted May 18, 2015 Report Share Posted May 18, 2015 yeah, i see what you mean, can place the pad on the top level, it literally spawns 15m above it hangs there till takes dmg, falls to ground and blows up need to adjust the re spawn hight above item, seems to be to much Which script are you using then now? Link to comment Share on other sites More sharing options...
0 Buck0 Posted May 18, 2015 Report Share Posted May 18, 2015 https://github.com/0verHeaT/VehicleGarage Link to comment Share on other sites More sharing options...
0 Guest Posted May 18, 2015 Report Share Posted May 18, 2015 https://github.com/0verHeaT/VehicleGarage So you made a HeliPad under that Metal Floor in the Screenshot? Did you try adding the Metal Floor to _helipads = ["HeliH","HeliHCivil","HeliHRescue","MAP_Heli_H_army","MAP_Heli_H_cross"]; ? Link to comment Share on other sites More sharing options...
0 Buck0 Posted May 18, 2015 Report Share Posted May 18, 2015 i placed a helipad ontop of the metal floor, for some reason, its getting all jacked up and adding an additional height parameter ontop of the helipad, it seems the higher it goes, the worse it gets Would something like this work? setPosATL [getposATL this select 0, getposATL this select 1, 4]; forcing the height variable of 4m above the item? Link to comment Share on other sites More sharing options...
0 SchwEde Posted May 18, 2015 Report Share Posted May 18, 2015 try chaning this line _position = getPosATL _nearestpad; into this: _position = getPos _nearestpad; 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