moin gibt es die Möglichkeit bei einzelnen fahrzeugspawns die höhe in der die fahrzeuge spawnen sollen zu definieren?
Fahrzeugspawns
-
SelfTanoa -
6. Februar 2017 um 14:58 -
Geschlossen -
Erledigt
-
-
Ja über ein trick z.b. Beim kaufen must du im script sagen ist Maker xy dan Spawn Posi .....
-
das wäre dann ja wahrscheinlich in der fn_vehicleShopBuy
und würde wie aussehen
-
Hier ein Beispiel habe die fn_vehicleShopBuy.sqf aus der AL Version 4.4 genommen
C
Alles anzeigen#include "..\..\script_macros.hpp" /* File: fn_vehicleShopBuy.sqf Author: Bryan "Tonic" Boardwine Description: Does something with vehicle purchasing. */ private["_mode","_vIndex","_spawnPoints","_className","_purchasePrice","_buyMultiplier","_rentMultiplier","_colorIndex","_spawnPoint","_vehicle","_vehicleList","_shopSide","_licenses","_licensesName","_exit","_initalPrice"]; _mode = _this select 0; _exit = false; if ((lbCurSel 2302) isEqualTo -1) exitWith {hint localize "STR_Shop_Veh_DidntPick";closeDialog 0;}; _className = lbData[2302,(lbCurSel 2302)]; _vIndex = lbValue[2302,(lbCurSel 2302)]; _vehicleList = M_CONFIG(getArray,"CarShops",(life_veh_shop select 0),"vehicles"); _shopSide = M_CONFIG(getText,"CarShops",(life_veh_shop select 0),"side"); _licenses = switch (playerSide) do { case civilian: {(M_CONFIG(getArray,"LifeCfgVehicles",_className,"licenses") select 0)}; case west: {(M_CONFIG(getArray,"LifeCfgVehicles",_className,"licenses") select 1)}; case independent: {(M_CONFIG(getArray,"LifeCfgVehicles",_className,"licenses") select 2)}; case east: {(M_CONFIG(getArray,"LifeCfgVehicles",_className,"licenses") select 3)}; }; _initalPrice = M_CONFIG(getNumber,"LifeCfgVehicles",_className,"price"); switch (playerSide) do { case civilian: { _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_CIVILIAN"); _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_CIVILIAN"); }; case west: { _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_COP"); _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_COP"); }; case independent: { _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_MEDIC"); _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_MEDIC"); }; case east: { _buyMultiplier = LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_OPFOR"); _rentMultiplier = LIFE_SETTINGS(getNumber,"vehicle_rental_multiplier_OPFOR"); }; }; if (_mode) then { _purchasePrice = round(_initalPrice * _buyMultiplier); } else { _purchasePrice = round(_initalPrice * _rentMultiplier); }; _colorIndex = lbValue[2304,(lbCurSel 2304)]; _licensesName = ""; { if (!(_x isEqualTo "") && {!(LICENSE_VALUE(_x,_shopSide))}) then { _licensesName = _licensesName + localize M_CONFIG(getText,"Licenses",_x,"displayName") + "<br/>"; _exit = true; }; } forEach _licenses; if (_exit) exitWith {hint parseText format[(localize "STR_Shop_Veh_NoLicense")+ "<br/><br/>%1",_licensesName];closeDialog 0;}; if (_purchasePrice < 0) exitWith {closeDialog 0;}; //Bad price entry if (CASH < _purchasePrice) exitWith {hint format[localize "STR_Shop_Veh_NotEnough",[_purchasePrice - CASH] call life_fnc_numberText];closeDialog 0;}; _spawnPoints = life_veh_shop select 1; _spawnPoint = ""; if (((life_veh_shop select 0) == "med_air_hs")) then { if ((nearestObjects[(getMarkerPos _spawnPoints),["Air"],35]) isEqualTo []) exitWith {_spawnPoint = _spawnPoints}; } else { //Check if there is multiple spawn points and find a suitable spawnpoint. if (_spawnPoints isEqualType []) then { //Find an available spawn point. {if ((nearestObjects[(getMarkerPos _x),["Car","Ship","Air"],5]) isEqualTo []) exitWith {_spawnPoint = _x};} forEach _spawnPoints; } else { if ((nearestObjects[(getMarkerPos _spawnPoints),["Car","Ship","Air"],5]) isEqualTo []) exitWith {_spawnPoint = _spawnPoints}; }; }; if (_spawnPoint isEqualTo "") exitWith {hint localize "STR_Shop_Veh_Block";closeDialog 0;}; CASH = CASH - _purchasePrice; hint format[localize "STR_Shop_Veh_Bought",getText(configFile >> "CfgVehicles" >> _className >> "displayName"),[_purchasePrice] call life_fnc_numberText]; //Spawn the vehicle and prep it. if ((life_veh_shop select 0) == "med_air_hs") then { _vehicle = createVehicle [_className,[0,0,999],[], 0, "NONE"]; waitUntil {!isNil "_vehicle" && {!isNull _vehicle}}; //Wait? _vehicle allowDamage false; _hs = nearestObjects[getMarkerPos _spawnPoint,["Land_Hospital_side2_F"],50] select 0; _vehicle setPosATL (_hs modelToWorld [-0.4,-4,12.65]); sleep 0.6; } else { ///////////AB Hier Geändert _pos = getMarkerPos _spawnPoint; _dir = markerDir _spawnPoint; if(_spawnPoint isEqualTo "DEIN Marker")then{ _pos = [3881.64,5312.35,1.91677]; _dir = 32.9061; }; _vehicle = createVehicle [_className, _pos, [], 0, "NONE"]; waitUntil {!isNil "_vehicle" && {!isNull _vehicle}}; //Wait? _vehicle allowDamage false; //Temp disable damage handling.. _vehicle setPos _pos; _vehicle setVectorUp (surfaceNormal (getMarkerPos _spawnPoint)); _vehicle setDir _dir; }; /////Bis Hier _vehicle lock 2; [_vehicle,_colorIndex] call life_fnc_colorVehicle; [_vehicle] call life_fnc_clearVehicleAmmo; [_vehicle,"trunk_in_use",false,true] remoteExecCall ["TON_fnc_setObjVar",RSERV]; [_vehicle,"vehicle_info_owners",[[getPlayerUID player,profileName]],true] remoteExecCall ["TON_fnc_setObjVar",RSERV]; _vehicle disableTIEquipment true; //No Thermals.. They're cheap but addictive. //Side Specific actions. switch (playerSide) do { case west: { [_vehicle,"cop_offroad",true] spawn life_fnc_vehicleAnimate; }; case civilian: { if ((life_veh_shop select 2) isEqualTo "civ" && {_className == "B_Heli_Light_01_F"}) then { [_vehicle,"civ_littlebird",true] spawn life_fnc_vehicleAnimate; }; }; case independent: { [_vehicle,"med_offroad",true] spawn life_fnc_vehicleAnimate; }; }; _vehicle allowDamage true; life_vehicles pushBack _vehicle; //Always handle key management by the server [getPlayerUID player,playerSide,_vehicle,1] remoteExecCall ["TON_fnc_keyManagement",RSERV]; if (_mode) then { if (!(_className in ["B_G_Offroad_01_armed_F","B_MRAP_01_hmg_F"])) then { if (life_HC_isActive) then { [(getPlayerUID player),playerSide,_vehicle,_colorIndex] remoteExecCall ["HC_fnc_vehicleCreate",HC_Life]; } else { [(getPlayerUID player),playerSide,_vehicle,_colorIndex] remoteExecCall ["TON_fnc_vehicleCreate",RSERV]; }; }; }; if (LIFE_SETTINGS(getNumber,"player_advancedLog") isEqualTo 1) then { if (LIFE_SETTINGS(getNumber,"battlEye_friendlyLogging") isEqualTo 1) then { advanced_log = format ["bought vehicle %1 for $%2. On Hand Cash: $%3 Bank Balance: $%4",_className,[_purchasePrice] call life_fnc_numberText,[CASH] call life_fnc_numberText,[BANK] call life_fnc_numberText]; } else { advanced_log = format ["%1 - %2 bought vehicle %3 for $%4. On Hand Cash: $%5 Bank Balance $%6",profileName,(getPlayerUID player),_className,[_purchasePrice] call life_fnc_numberText,[CASH] call life_fnc_numberText,[BANK] call life_fnc_numberText]; }; publicVariableServer "advanced_log"; }; [0] call SOCK_fnc_updatePartial; closeDialog 0; //Exit the menu. true;
Habe es Makiert von wo bis wo ich was geändert habe
etwa ab Zeile 94
-
teste ich mal thx
-
leider funktioniert es nicht
mein Code sieht so aus
nutze die 5.0
Spoiler anzeigen
Code
Alles anzeigenif ((life_veh_shop select 0) == "med_air_hs") then { _vehicle = createVehicle [_className,[0,0,999],[], 0, "NONE"]; waitUntil {!isNil "_vehicle" && {!isNull _vehicle}}; //Wait? _vehicle allowDamage false; _hs = nearestObjects[getMarkerPos _spawnPoint,["Land_Hospital_side2_F"],50] select 0; _vehicle setPosATL (_hs modelToWorld [-0.4,-4,12.65]); sleep 0.6; } else { if(_spawnPoint isEqualTo "reb_h_1")then{ _pos = [4066.14,4066.14,20]; _dir = 91.995; }; if(_spawnPoint isEqualTo "reb_v_1")then{ _pos = [8654.217,4066.14,20]; _dir = 91.995; }; _vehicle = createVehicle [_className, (getMarkerPos _spawnPoint), [], 0, "NONE"]; waitUntil {!isNil "_vehicle" && {!isNull _vehicle}}; //Wait? _vehicle allowDamage false; //Temp disable damage handling.. _vehicle setPos (getMarkerPos _spawnPoint); _vehicle setVectorUp (surfaceNormal (getMarkerPos _spawnPoint)); _vehicle setDir (markerDir _spawnPoint); };
-
Guck dir den code genau an deiner ist auch noch falsch habe extra makiert von wo bis wo ich was geändert habe
-
wunderbar es geht jetzt hast du auch ne Möglichkeit das für die Garage zu machen ?
-
ist etwa gleich aufgebaut nur müsstest du das in der fn_unimpound.sqf umbauen
sollte dan so Aussehn
C
Alles anzeigen#include "..\..\script_macros.hpp" /* File: fn_unimpound.sqf Author: Bryan "Tonic" Boardwine Description: Yeah... Gets the vehicle from the garage. */ private ["_vehicle","_vehicleLife","_vid","_pid","_unit","_price","_price","_storageFee","_purchasePrice"]; disableSerialization; if ((lbCurSel 2802) isEqualTo -1) exitWith {hint localize "STR_Global_NoSelection"}; _vehicle = lbData[2802,(lbCurSel 2802)]; _vehicle = (call compile format ["%1",_vehicle]) select 0; _vehicleLife = _vehicle; _vid = lbValue[2802,(lbCurSel 2802)]; _pid = getPlayerUID player; _unit = player; _spawntext = localize "STR_Garage_spawn_Success"; if (isNil "_vehicle") exitWith {hint localize "STR_Garage_Selection_Error"}; if (!isClass (missionConfigFile >> "LifeCfgVehicles" >> _vehicleLife)) then { _vehicleLife = "Default"; //Use Default class if it doesn't exist diag_log format ["%1: LifeCfgVehicles class doesn't exist",_vehicle]; }; _price = M_CONFIG(getNumber,"LifeCfgVehicles",_vehicleLife,"price"); _storageFee = LIFE_SETTINGS(getNumber,"vehicle_storage_fee_multiplier"); switch (playerSide) do { case civilian: {_purchasePrice = _price * LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_CIVILIAN");}; case west: {_purchasePrice = _price * LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_COP");}; case independent: {_purchasePrice = _price * LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_MEDIC");}; case east: {_purchasePrice = _price * LIFE_SETTINGS(getNumber,"vehicle_purchase_multiplier_OPFOR");}; }; _price = _purchasePrice * _storageFee; if (!(_price isEqualType 0) || _price < 1) then {_price = 500;}; if (BANK < _price) exitWith {hint format [(localize "STR_Garage_CashError"),[_price] call life_fnc_numberText];}; if (life_garage_sp isEqualType []) then { if (life_HC_isActive) then { [_vid,_pid,(life_garage_sp select 0),_unit,_price,(life_garage_sp select 1),_spawntext] remoteExec ["HC_fnc_spawnVehicle",HC_Life]; } else { [_vid,_pid,(life_garage_sp select 0),_unit,_price,(life_garage_sp select 1),_spawntext] remoteExec ["TON_fnc_spawnVehicle",RSERV]; }; } else { if (life_garage_sp in ["medic_spawn_1","medic_spawn_2","medic_spawn_3"]) then { if (life_HC_isActive) then { [_vid,_pid,life_garage_sp,_unit,_price,0,_spawntext] remoteExec ["HC_fnc_spawnVehicle",HC_Life]; } else { [_vid,_pid,life_garage_sp,_unit,_price,0,_spawntext] remoteExec ["TON_fnc_spawnVehicle",RSERV]; }; } else { /////Hier Geändert _pos = getMarkerPos life_garage_sp; _dir = markerDir life_garage_sp; if(life_garage_sp isEqualTo "DEIN MARKER")then{ _pos = [3881.64,5312.35,1.91677]; _dir = 32.9061; }; if (life_HC_isActive) then { [_vid,_pid,_pos,_unit,_price,_dir,_spawntext] remoteExec ["HC_fnc_spawnVehicle",HC_Life]; } else { [_vid,_pid,_pos,_unit,_dir,_spawntext] remoteExec ["TON_fnc_spawnVehicle",RSERV]; }; };///Bis Hier };
-
Soo funst eig soweit ganz gut wenn jetzt nicht plötzlich das hier wäre
Spoiler anzeigen
Code
Alles anzeigen16:26:00 Unaccessible 16:27:04 Error in expression <y") isEqualTo 1)) then { _items = _gear select 0; _mags = _gear select 1; _weapo> 16:27:04 Error position: <select 0; _mags = _gear select 1; _weapo> 16:27:04 Error Generic error in expression 16:27:04 File life_server\Functions\Systems\fn_spawnVehicle.sqf, line 144 16:27:14 Error in expression < ["Trunk", [[], 0]]; _itemList = _trunk select 0; _totalweight = 0; _items = [];> 16:27:14 Error position: <select 0; _totalweight = 0; _items = [];> 16:27:14 Error Generic error in expression 16:27:14 File life_server\Functions\Systems\fn_vehicleStore.sqf, line 75 16:27:45 Server: Object 3:22 not found (message Type_121) 16:27:45 Server: Object 3:21 not found (message Type_121) 16:27:45 Server: Object 3:23 not found (message Type_93) 16:27:45 Server: Object 3:24 not found (message Type_93) 16:27:46 Error: Object(3 : 23) not found 16:27:46 Error: Object(3 : 24) not found 16:27:53 Error in expression <y") isEqualTo 1)) then { _items = _gear select 0; _mags = _gear select 1; _weapo> 16:27:53 Error position: <select 0; _mags = _gear select 1; _weapo> 16:27:53 Error Generic error in expression 16:27:53 File life_server\Functions\Systems\fn_spawnVehicle.sqf, line 144 16:28:05 Client: Remote object 3:0 not found 16:28:15 Warning: Cleanup player - person 2:2218 not found 16:28:22 Unaccessible 16:28:22 No speaker given for Spencer Bayh 16:28:22 Speaker Male01_F not found in CfgVoiceTypes 16:28:23 Error: Object(3 : 28) not found 16:28:23 Error: Object(3 : 29) not found 16:29:18 Error in expression <y") isEqualTo 1)) then { _items = _gear select 0; _mags = _gear select 1; _weapo> 16:29:18 Error position: <select 0; _mags = _gear select 1; _weapo> 16:29:18 Error Generic error in expression 16:29:18 File life_server\Functions\Systems\fn_spawnVehicle.sqf, line 144 16:29:25 Error in expression < ["Trunk", [[], 0]]; _itemList = _trunk select 0; _totalweight = 0; _items = [];> 16:29:25 Error position: <select 0; _totalweight = 0; _items = [];> 16:29:25 Error Generic error in expression 16:29:25 File life_server\Functions\Systems\fn_vehicleStore.sqf, line 75
-
mhhh siet mir nach nem Fehler aus vermute er bekommt nicht die richtigen Daten aus der DB
bzw du nutzt die 5.0 Datein ?
-
-
@br1zey haste denn ne Ahnung wie man das für die 5.0 hin bekommt ??
-
Genau kann ich es nicht sagen aber ich denke einfach das da werte nicht richtig übergeben werden ist das den von Anfang an so gewesen ?
-
nein erst nach dem ich deinen code eingefügt hatte
-
mhh dan änder das weider zurück da hast anscheinend ein Fehler gemacht oder ich xD wenn du meine datei genommen hast ist das klar die ist für 4.4
-
könntest du dir das dann bitte mal für die 5.0 anschauen und gucken ob du da was hinbekommst ??
-
sollte im grunde gleich sein schcik mal deine datei die geht
-
da haste alles
-
und mit dem opriganal datein hast du den fehler nicht ?
-