Bei mir ist die grange jetzt auch einmal leer habe mir ein neues fahrzeug gekauft und eingeparkt dan leer habe es auch beschlagnahmt dan ist die grage wie die immpount stelle leer
[Tutorial 4.4R4+] Verwahrungsstelle nach Impounden
-
- Altis Life
-
br1zey -
25. Juni 2016 um 00:18
-
-
DB Fehler. DB Logs bitte anhängen
-
wo finde ich die db logs in extdb3?
-
Unter dem Pfrad @extDB3/logs/2017/10/"aktuellerTag"/
-
Hey,
bei mir funktioniert alles bis auf das freikaufen
habe dazu auch hier ein Fehler:
Code
Alles anzeigen8:47:23 Error in expression <,((_parts select 0) select _i)],_damage select _i]; }; }; if ((_vInfo selec> 8:47:23 Error position: <select _i]; }; }; if ((_vInfo selec> 8:47:23 Error Generic error in expression 8:47:23 File \life_server\Functions\Systems\fn_spawnVehicle.sqf [TON_fnc_spawnVehicle], line 275
das komische ist das die datei nur 247 zeilen lang ist xD
hier ist die datei:
Code
Alles anzeigen#include "\life_server\script_macros.hpp" /* File: fn_spawnVehicle.sqf Author: Bryan "Tonic" Boardwine Description: Sends the query request to the database, if an array is returned then it creates the vehicle if it's not in use or dead. */ private ["_vid","_sp","_pid","_query","_sql","_vehicle","_nearVehicles","_name","_side","_tickTime","_dir","_servIndex","_damage","_wasIllegal","_location","_thread"]; _vid = [_this,0,-1,[0]] call BIS_fnc_param; _pid = [_this,1,"",[""]] call BIS_fnc_param; _sp = [_this,2,[],[[],""]] call BIS_fnc_param; _unit = [_this,3,objNull,[objNull]] call BIS_fnc_param; _price = [_this,4,0,[0]] call BIS_fnc_param; _dir = [_this,5,0,[0]] call BIS_fnc_param; _spawntext = _this select 6; _unit_return = _unit; _name = name _unit; _side = side _unit; _unit = owner _unit; if (_vid isEqualTo -1 || _pid isEqualTo "") exitWith {}; if (_vid in serv_sv_use) exitWith {}; serv_sv_use pushBack _vid; _servIndex = serv_sv_use find _vid; _query = format ["SELECT id, side, classname, type, pid, alive, active, plate, color, inventory, gear, fuel, damage, blacklist, impound FROM vehicles WHERE id='%1' AND pid='%2'",_vid,_pid]; _tickTime = diag_tickTime; _queryResult = [_query,2] call DB_fnc_asyncCall; if (EXTDB_SETTING(getNumber,"DebugMode") isEqualTo 1) then { diag_log "------------- Client Query Request -------------"; diag_log format ["QUERY: %1",_query]; diag_log format ["Time to complete: %1 (in seconds)",(diag_tickTime - _tickTime)]; diag_log format ["Result: %1",_queryResult]; diag_log "------------------------------------------------"; }; if (_queryResult isEqualType "") exitWith {}; _vInfo = _queryResult; if (isNil "_vInfo") exitWith {serv_sv_use deleteAt _servIndex;}; if (count _vInfo isEqualTo 0) exitWith {serv_sv_use deleteAt _servIndex;}; if ((_vInfo select 5) isEqualTo 0) exitWith { serv_sv_use deleteAt _servIndex; [1,"STR_Garage_SQLError_Destroyed",true,[_vInfo select 2]] remoteExecCall ["life_fnc_broadcast",_unit]; }; if ((_vInfo select 6) isEqualTo 1) exitWith { serv_sv_use deleteAt _servIndex; [1,"STR_Garage_SQLError_Active",true,[_vInfo select 2]] remoteExecCall ["life_fnc_broadcast",_unit]; }; if (!(_sp isEqualType "")) then { _nearVehicles = nearestObjects[_sp,["Car","Air","Ship"],10]; } else { _nearVehicles = []; }; if (count _nearVehicles > 0) exitWith { serv_sv_use deleteAt _servIndex; [_price,_unit_return] remoteExecCall ["life_fnc_garageRefund",_unit]; [1,"STR_Garage_SpawnPointError",true] remoteExecCall ["life_fnc_broadcast",_unit]; }; _query = format ["UPDATE vehicles SET active='1', impound='0', damage='""[]""' WHERE pid='%1' AND id='%2'",_pid,_vid]; _trunk = [(_vInfo select 9)] call DB_fnc_mresToArray; _gear = [(_vInfo select 10)] call DB_fnc_mresToArray; _damage = [(_vInfo select 12)] call DB_fnc_mresToArray; _wasIllegal = (_vInfo select 13); _wasIllegal = if (_wasIllegal isEqualTo 1) then { true } else { false }; [_query,1] call DB_fnc_asyncCall; if (_sp isEqualType "") then { _vehicle = createVehicle[(_vInfo select 2),[0,0,999],[],0,"NONE"]; waitUntil {!isNil "_vehicle" && {!isNull _vehicle}}; _vehicle allowDamage false; _hs = nearestObjects[getMarkerPos _sp,["Land_Hospital_side2_F"],50] select 0; _vehicle setPosATL (_hs modelToWorld [-0.4,-4,12.65]); uiSleep 0.6; } else { _vehicle = createVehicle [(_vInfo select 2),_sp,[],0,"NONE"]; waitUntil {!isNil "_vehicle" && {!isNull _vehicle}}; _vehicle allowDamage false; _vehicle setPos _sp; _vehicle setVectorUp (surfaceNormal _sp); _vehicle setDir _dir; }; _vehicle allowDamage true; //Send keys over the network. [_vehicle] remoteExecCall ["life_fnc_addVehicle2Chain",_unit]; [_pid,_side,_vehicle,1] call TON_fnc_keyManagement; _vehicle lock 2; //Reskin the vehicle [_vehicle,(_vInfo select 8)] remoteExecCall ["life_fnc_colorVehicle",_unit]; _vehicle setVariable ["vehicle_info_owners",[[_pid,_name]],true]; _vehicle setVariable ["dbInfo",[(_vInfo select 4),(_vInfo select 7)],true]; _vehicle disableTIEquipment true; //No Thermals.. They're cheap but addictive. [_vehicle] call life_fnc_clearVehicleAmmo; // Avoid problems if u keep changing which stuff to save! if (LIFE_SETTINGS(getNumber,"save_vehicle_virtualItems") isEqualTo 1) then { _vehicle setVariable ["Trunk",_trunk,true]; if (_wasIllegal) then { if (_sp isEqualType "") then { _location= (nearestLocations [getPos _sp,["NameCityCapital","NameCity","NameVillage"],1000]) select 0; } else { _location= (nearestLocations [_sp,["NameCityCapital","NameCity","NameVillage"],1000]) select 0; }; _location = text _location; [1,"STR_NOTF_BlackListedVehicle",true,[_location,_name]] remoteExecCall ["life_fnc_broadcast",west]; _query = format ["UPDATE vehicles SET blacklist='0' WHERE id='%1' AND pid='%2'",_vid,_pid]; _thread = [_query,1] call DB_fnc_asyncCall; }; }else{ _vehicle setVariable ["Trunk",[[],0],true]; }; if (LIFE_SETTINGS(getNumber,"save_vehicle_fuel") isEqualTo 1) then { _vehicle setFuel (_vInfo select 11); }else{ _vehicle setFuel 1; }; if (count _gear > 0 && (LIFE_SETTINGS(getNumber,"save_vehicle_inventory") isEqualTo 1)) then { _items = _gear select 0; _mags = _gear select 1; _weapons = _gear select 2; _backpacks = _gear select 3; for "_i" from 0 to ((count (_items select 0)) - 1) do { _vehicle addItemCargoGlobal [((_items select 0) select _i), ((_items select 1) select _i)]; }; for "_i" from 0 to ((count (_mags select 0)) - 1) do { _vehicle addMagazineCargoGlobal [((_mags select 0) select _i), ((_mags select 1) select _i)]; }; for "_i" from 0 to ((count (_weapons select 0)) - 1) do { _vehicle addWeaponCargoGlobal [((_weapons select 0) select _i), ((_weapons select 1) select _i)]; }; for "_i" from 0 to ((count (_backpacks select 0)) - 1) do { _vehicle addBackpackCargoGlobal [((_backpacks select 0) select _i), ((_backpacks select 1) select _i)]; }; }; if (count _damage > 0 && (LIFE_SETTINGS(getNumber,"save_vehicle_damage") isEqualTo 1)) then { _parts = getAllHitPointsDamage _vehicle; for "_i" from 0 to ((count _damage) - 1) do { _vehicle setHitPointDamage [format ["%1",((_parts select 0) select _i)],_damage select _i]; }; }; //Sets of animations if ((_vInfo select 1) isEqualTo "civ" && (_vInfo select 2) isEqualTo "B_Heli_Light_01_F" && !((_vInfo select 8) isEqualTo 13)) then { [_vehicle,"civ_littlebird",true] remoteExecCall ["life_fnc_vehicleAnimate",_unit]; }; if ((_vInfo select 1) isEqualTo "cop" && ((_vInfo select 2)) in ["C_Offroad_01_F","B_MRAP_01_F","C_SUV_01_F","C_Hatchback_01_sport_F","B_Heli_Light_01_F","B_Heli_Transport_01_F"]) then { [_vehicle,"cop_offroad",true] remoteExecCall ["life_fnc_vehicleAnimate",_unit]; }; if ((_vInfo select 1) isEqualTo "med" && (_vInfo select 2) isEqualTo "C_Offroad_01_F") then { [_vehicle,"med_offroad",true] remoteExecCall ["life_fnc_vehicleAnimate",_unit]; }; [1,_spawntext] remoteExecCall ["life_fnc_broadcast",_unit]; serv_sv_use deleteAt _servIndex;
danke
-
hat sich erledigt sorry
hab einfach die datein nicht copy paste genommen sondern die unterschiede ausgemacht und dann übertragen da auch das VIS installiert war
-
Es läuft soweit auf der 5.0.0, zeigt jedoch einen merkwürdigen Fehler in der Serverkonsole an, das Freikaufen geht manchmal und manchmal nicht.
Code
Alles anzeigen13:24:00 Error in expression <,((_parts select 0) select _i)],_damage select _i]; }; }; if ((_vInfo selec> 13:24:00 Error position: <select _i]; }; }; if ((_vInfo selec> 13:24:00 Error Generic error in expression 13:24:00 File \life_server\Functions\Systems\fn_spawnVehicle.sqf [TON_fnc_spawnVehicle], line 275 Error: Object(3 : 16) not found
-
Folgendes Problem: Wenn ich die Garage öffnen will kommt Ihrgentwas mit life_impounded_menu not found ...
-
clientlog?
-
Gefixt hatte die falsche impound.hpp
-
Hallo,
ich habe das Tutorial soweit ausgeführt die Connection zur Datenbank steht und das Fahrzeug verschwindet auch es wird aber nicht in der Verwahrstelle angezeigt.
-
Hallo,
ich habe das Tutorial soweit ausgeführt die Connection zur Datenbank steht und das Fahrzeug verschwindet auch es wird aber nicht in der Verwahrstelle angezeigt.
Code
Alles anzeigen14:44:12 Error in expression <,((_parts select 0) select _i)],_damage select _i]; }; }; if ((_vInfo select 1)> 14:44:12 Error position: <select _i]; }; }; if ((_vInfo select 1)> 14:44:12 Error Generic error in expression 14:44:12 File \life_server\Functions\Systems\fn_spawnVehicle.sqf [TON_fnc_spawnVehicle], line 191
hast du das vis system eingefügt?
-
Nices System.
-
Habe das Aktuell noch nicht gefunden, aber ist es möglich das die Sanitäter und Cops Fahrzeuge nicht in der Verwahrstelle landen sondern nur normal in der Garage? Das Fraktionen aus dem System ausgetragen werden und die Verwahrstelle nur für Civs ist?
Und wenn ja, was muss ich tun?
Danke im vorraus und
MFG
Hannkok
-
ich gucke später nochmal aber an sich sollte es irgendwo eine abfrage geben zu welcher seite das fahrzeug gehört
dort müsstest du die fraktionen weiter eintragen
-
Probier es mal so:
Code: life_server\Functions\System\fn_vehicleImpound.sqf
Alles anzeigen#include "\life_server\script_macros.hpp" /* File: fn_vehicleStore.sqf Author: Bryan "Tonic" Boardwine Description: Stores the vehicle in the 'Garage' */ private ["_vehicle","_impound","_vInfo","_vInfo","_plate","_uid","_query","_sql","_unit","_trunk","_vehItems","_vehMags","_vehWeapons","_vehBackpacks","_cargo","_saveItems","_storetext","_resourceItems","_fuel","_damage","_itemList","_totalweight","_weight","_thread"]; _vehicle = [_this,0,objNull,[objNull]] call BIS_fnc_param; _impound = [_this,1,false,[true]] call BIS_fnc_param; _unit = [_this,2,objNull,[objNull]] call BIS_fnc_param; _storetext = [_this,3,"",[""]] call BIS_fnc_param; _resourceItems = LIFE_SETTINGS(getArray,"save_vehicle_items"); if (isNull _vehicle || isNull _unit) exitWith {life_impound_inuse = false; (owner _unit) publicVariableClient "life_impound_inuse";life_garage_store = false;(owner _unit) publicVariableClient "life_garage_store";}; //Bad data passed. _vInfo = _vehicle getVariable ["dbInfo",[]]; if (count _vInfo > 0) then { _plate = _vInfo select 1; _uid = _vInfo select 0; }; // save damage. if (LIFE_SETTINGS(getNumber,"save_vehicle_damage") isEqualTo 1) then { _damage = getAllHitPointsDamage _vehicle; _damage = _damage select 2; } else { _damage = []; }; _damage = [_damage] call DB_fnc_mresArray; // because fuel price! if (LIFE_SETTINGS(getNumber,"save_vehicle_fuel") isEqualTo 1) then { _fuel = (fuel _vehicle); } else { _fuel = 1; }; if (_impound) exitWith { if (count _vInfo isEqualTo 0) then { life_impound_inuse = false; (owner _unit) publicVariableClient "life_impound_inuse"; if (!isNil "_vehicle" && {!isNull _vehicle}) then { deleteVehicle _vehicle; }; } else { // no free repairs! _query = format ["SELECT id, side FROM vehicles WHERE pid='%1' AND plate='%2'",_uid , _plate]; private _queryResult = [_query,2] call DB_fnc_asyncCall; private _side = _queryResult select 1; if (_side isEqualTo "civ") then { _query = format ["UPDATE vehicles SET active='0', impound='1', fuel='%3', damage='%4' WHERE pid='%1' AND plate='%2'",_uid , _plate, _fuel, _damage]; } else { _query = format ["UPDATE vehicles SET active='0', impound='0', fuel='%3', damage='%4' WHERE pid='%1' AND plate='%2'",_uid , _plate, _fuel, _damage]; }; _thread = [_query,1] call DB_fnc_asyncCall; if (!isNil "_vehicle" && {!isNull _vehicle}) then { deleteVehicle _vehicle; }; life_impound_inuse = false; (owner _unit) publicVariableClient "life_impound_inuse"; }; }; // not persistent so just do this! if (count _vInfo isEqualTo 0) exitWith { [1,"STR_Garage_Store_NotPersistent",true] remoteExecCall ["life_fnc_broadcast",(owner _unit)]; life_garage_store = false; (owner _unit) publicVariableClient "life_garage_store"; }; if (_uid != getPlayerUID _unit) exitWith { [1,"STR_Garage_Store_NoOwnership",true] remoteExecCall ["life_fnc_broadcast",(owner _unit)]; life_garage_store = false; (owner _unit) publicVariableClient "life_garage_store"; }; // sort out whitelisted items! _trunk = _vehicle getVariable ["Trunk", [[], 0]]; _itemList = _trunk select 0; _totalweight = 0; _items = []; if (LIFE_SETTINGS(getNumber,"save_vehicle_virtualItems") isEqualTo 1) then { if (LIFE_SETTINGS(getNumber,"save_vehicle_illegal") isEqualTo 1) then { private ["_isIllegal", "_blacklist"]; _blacklist = false; _profileQuery = format ["SELECT name FROM players WHERE pid='%1'", _uid]; _profileName = [_profileQuery, 2] call DB_fnc_asyncCall; _profileName = _profileName select 0; { _isIllegal = M_CONFIG(getNumber,"VirtualItems",(_x select 0),"illegal"); _isIllegal = if (_isIllegal isEqualTo 1) then { true } else { false }; if (((_x select 0) in _resourceItems) || (_isIllegal)) then { _items pushBack[(_x select 0),(_x select 1)]; _weight = (ITEM_WEIGHT(_x select 0)) * (_x select 1); _totalweight = _weight + _totalweight; }; if (_isIllegal) then { _blacklist = true; }; } foreach _itemList; if (_blacklist) then { [_uid, _profileName, "481"] remoteExecCall["life_fnc_wantedAdd", RSERV]; _query = format ["UPDATE vehicles SET blacklist='1' WHERE pid='%1' AND plate='%2'", _uid, _plate]; _thread = [_query, 1] call DB_fnc_asyncCall; }; } else { { if ((_x select 0) in _resourceItems) then { _items pushBack[(_x select 0),(_x select 1)]; _weight = (ITEM_WEIGHT(_x select 0)) * (_x select 1); _totalweight = _weight + _totalweight; }; } forEach _itemList; }; _trunk = [_items, _totalweight]; } else { _trunk = [[], 0]; }; if (LIFE_SETTINGS(getNumber,"save_vehicle_inventory") isEqualTo 1) then { _vehItems = getItemCargo _vehicle; _vehMags = getMagazineCargo _vehicle; _vehWeapons = getWeaponCargo _vehicle; _vehBackpacks = getBackpackCargo _vehicle; _cargo = [_vehItems,_vehMags,_vehWeapons,_vehBackpacks]; // no items? clean the array so the database looks pretty if ((count (_vehItems select 0) isEqualTo 0) && (count (_vehMags select 0) isEqualTo 0) && (count (_vehWeapons select 0) isEqualTo 0) && (count (_vehBackpacks select 0) isEqualTo 0)) then {_cargo = [];}; } else { _cargo = []; }; // prepare _trunk = [_trunk] call DB_fnc_mresArray; _cargo = [_cargo] call DB_fnc_mresArray; // update _query = format ["UPDATE vehicles SET active='0', impound='1', inventory='%3', gear='%4', fuel='%5', damage='%6' WHERE pid='%1' AND plate='%2'", _uid, _plate, _trunk, _cargo, _fuel, _damage]; _thread = [_query,1] call DB_fnc_asyncCall; if (!isNil "_vehicle" && {!isNull _vehicle}) then { deleteVehicle _vehicle; }; life_garage_store = false; (owner _unit) publicVariableClient "life_garage_store"; [1,_storetext] remoteExecCall ["life_fnc_broadcast",(owner _unit)];
Ich habe diese Zeilen eingefügt:
Code_query = format ["SELECT id, side FROM vehicles WHERE pid='%1' AND plate='%2'",_uid , _plate]; private _queryResult = [_query,2] call DB_fnc_asyncCall; private _side = _queryResult select 1; if (_side isEqualTo "civ") then { _query = format ["UPDATE vehicles SET active='0', impound='1', fuel='%3', damage='%4' WHERE pid='%1' AND plate='%2'",_uid , _plate, _fuel, _damage]; } else { _query = format ["UPDATE vehicles SET active='0', impound='0', fuel='%3', damage='%4' WHERE pid='%1' AND plate='%2'",_uid , _plate, _fuel, _damage]; };
Der Server holt sich von der Datenbank die Seite des Fahrzeuges, und wenn diese civ ist, wird das Fahrzeug mit impound = 1 eingeparkt, ansonsten impound = 0.
-
Ich danke dir, klappt super
-
Îch weiß, das das der Fehler bereits genannt wurde, doch habe ich leider keine Lösung hierfür gefunden.
Wenn ich ein Fahrzeug einparke, oder beschlagnahme, dann kann ich es erst nach Neustart wieder ausparken.
Folgende Fehler kommen in den RPT:
Code: Server RPT2019/06/26, 1:23:31 Error in expression <,((_parts select 0) select _i)],_damage select _i]; }; }; [1,_spawntext] remoteE> 2019/06/26, 1:23:31 Error position: <select _i]; }; }; [1,_spawntext] remoteE> 2019/06/26, 1:23:31 Error Generic error in expression 2019/06/26, 1:23:31 File \life_server\Functions\Systems\fn_spawnVehicle.sqf [TON_fnc_spawnVehicle], line 191
Code: Client RPT.1:25:53 Error in expression <chVehInfo; _control lbAdd (_vehicleInfo select 3); _tmp = [(_x select 2),(_x sel> 1:25:53 Error position: <select 3); _tmp = [(_x select 2),(_x sel> 1:25:53 Error Nullteiler 1:25:53 File dialog\function\fn_impoundMenu.sqf [life_fnc_impoundMenu], line 87
-
Dann löscht er bei dir nie 1 nicht im Feld active. Vielleicht hast das schreiben in die DB vertauscht. Bin am Handy, deshalb weiss ich net genau welche Datei. Aber es wird ja irgendwann in die DB übertragen dass er in der impound ist. Und wenn du schon weitere Sachen eingebaut hast, dann ist das evtl. Bei dir nicht das Feld zB 9 sonder 10, in das er die 1 für impound schreiben soll. Überprüft nochmal die Zuordnung der DB Felder mit den Feldern die du schickst, gerade die Reihenfolge. Und überprüfe die anhand deiner Systeme, nicht einfach hier übernehmen. Bei mir zB. Ist das alles um 3 erhöht, weil ich vorher andere Dinge eingebaut habe.
-
Das habe ich überprüft. In der DB wird das Fahrzeug auf inaktiv gesetzt.
Wenn ich die Garage wieder öffne, ist das Fahrzeug auch da, nur bleibt er hängen bei: Fahrzeug wird bereitgestellt, bitte warten
Ich habe die abgeänderten Dateien auch mit den alten überprüft und habe keine Fehler gefunden. Bis auf die geringen Änderungen habe ich nichts gesehen.
-