Zeile 137:
EQUAAL schreibt man nur mit einem A
Versicherungen für Fahrzeuge (Autos, LKW, Helikopter und Flugzeuge)
-
- Altis Life
-
nox -
23. Juni 2016 um 09:22
-
-
Zeile 137:
EQUAAL schreibt man nur mit einem A
Bringt mir immer noch diesen Fehler:Code
Alles anzeigen19:49:33 Error in expression <life_fnc_vehicleAnimate",_unit]; }; if( == 1) then { [1,"Ihr Fahrzeug ist bereit> 19:49:33 Error position: <== 1) then { [1,"Ihr Fahrzeug ist bereit> 19:49:33 Error Invalid number in expression 19:49:33 File life_server\Functions\Systems\fn_spawnVehicle.sqf, line 137 19:49:33 Error in expression <life_fnc_vehicleAnimate",_unit]; }; if( == 1) then { [1,"Ihr Fahrzeug ist bereit> 19:49:33 Error position: <== 1) then { [1,"Ihr Fahrzeug ist bereit> 19:49:33 Error Invalid number in expression 19:49:33 File life_server\Functions\Systems\fn_spawnVehicle.sqf, line 137
Habe es nun so drin stehen: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"]; _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; _unit_return = _unit; _name = name _unit; _side = side _unit; _unit = owner _unit; if(EQUAL(_vid,-1) OR EQUAL(_pid,"")) 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, insure 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") == 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(EQUAL(typeName _queryResult,typeName "")) exitWith {}; _vInfo = _queryResult; if(isNil "_vInfo") exitWith {serv_sv_use deleteAt _servIndex;}; if(EQUAL(count _vInfo,0)) exitWith {serv_sv_use deleteAt _servIndex;}; if(EQUAL(SEL(_vInfo,5),0)) exitWith { serv_sv_use deleteAt _servIndex; [1,format[(localize "STR_Garage_SQLError_Destroyed"),_vInfo select 2]] remoteExecCall ["life_fnc_broadcast",_unit]; }; if(EQUAL(SEL(_vInfo,6),1)) exitWith { serv_sv_use deleteAt _servIndex; [1,format[(localize "STR_Garage_SQLError_Active"),_vInfo select 2]] remoteExecCall ["life_fnc_broadcast",_unit]; }; if!(EQUAL(typeName _sp,typeName "")) 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,(localize "STR_Garage_SpawnPointError")] remoteExecCall ["life_fnc_broadcast",_unit]; }; _query = format["UPDATE vehicles SET active='1' WHERE pid='%1' AND id='%2'",_pid,_vid]; _trunk = [_vInfo select 9] call DB_fnc_mresToArray; _gear = [_vInfo select 10] call DB_fnc_mresToArray; [_query,false] spawn DB_fnc_asyncCall; if(typeName _sp == "STRING") 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]); sleep 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 setFuel (_vInfo select 11); _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,_vInfo select 9]]; _vehicle setVariable["Trunk",_trunk,true]; _vehicle disableTIEquipment true; //No Thermals.. They're cheap but addictive. [_vehicle] call life_fnc_clearVehicleAmmo; if (count _gear > 0) 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)]; }; }; //Sets of animations if(EQUAL(SEL(_vInfo,1),"civ") && EQUAL(SEL(_vInfo,2),"B_Heli_Light_01_F") && !(EQUAL(SEL(_vInfo,8),13))) then { [_vehicle,"civ_littlebird",true] remoteExecCall ["life_fnc_vehicleAnimate",_unit]; }; if(EQUAL(SEL(_vInfo,1),"cop") && (SEL(_vInfo,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(EQUAL(SEL(_vInfo,1),"med") && EQUAL(SEL(_vInfo,2),"C_Offroad_01_F")) then { [_vehicle,"med_offroad",true] remoteExecCall ["life_fnc_vehicleAnimate",_unit]; }; if(EQUAL(SEL(_vInfo,9)) == 1) then { [1,"Ihr Fahrzeug ist bereit und Versichert!"] remoteExecCall ["life_fnc_broadcast",_unit]; } else { [1,"Ihr Fahrzeug ist bereit!"] remoteExecCall ["life_fnc_broadcast",_unit]; }; serv_sv_use deleteAt _servIndex;
-
Kann es sein dass das <== falsch ist, sollte das nicht entweder == oder <= heißen?
-
Kann es sein dass das <== falsch ist, sollte das nicht entweder == oder <= heißen?
Wie meinst du das es steht doch == da ?
-
(EQUAL(SEL(_vInfo,9)) == 1)
abändern in
(EQUAL(SEL(_vInfo,9), 1))Entweder "EQUAL" oder "=="
-
Beim Error steht doch <== 1
-
Ups mein Fehler. Das < gehört ja zur Fehlermeldung.
-
Klasse Matthias Back to the roots... hats geklappt?
-
Klasse Matthias Back to the roots... hats geklappt?
Jop hat geklappt Super !
Danke dir @blackfisch
MfG -
Jetzt spamt er mir das hier in die RPT:
Code
Alles anzeigen20:46:07 "insureSystem = [[],0] " 20:46:07 Error in expression < %1 ", _insureSystem]; if(_insureSystem == 1) then { diag_log " Versichert !";> 20:46:07 Error position: <== 1) then { diag_log " Versichert !";> 20:46:07 Error Generic error in expression 20:46:07 Error in expression < %1 ", _insureSystem]; if(_insureSystem == 1) then { diag_log " Versichert !";> 20:46:07 Error position: <== 1) then { diag_log " Versichert !";> 20:46:07 Error Generic error in expression 20:46:07 " destroy vehicule !" 20:46:07 "insureSystem = [[],0] " 20:46:07 Error in expression < %1 ", _insureSystem]; if(_insureSystem == 1) then { diag_log " Versichert !";> 20:46:07 Error position: <== 1) then { diag_log " Versichert !";> 20:46:07 Error Generic error in expression 20:46:07 Error in expression < %1 ", _insureSystem]; if(_insureSystem == 1) then { diag_log " Versichert !";> 20:46:07 Error position: <== 1) then { diag_log " Versichert !";> 20:46:07 Error Generic error in expression 20:46:07 " destroy vehicule !" 20:46:07 "insureSystem = [[],0] " 20:46:07 Error in expression < %1 ", _insureSystem]; if(_insureSystem == 1) then { diag_log " Versichert !";> 20:46:07 Error position: <== 1) then { diag_log " Versichert !";> 20:46:07 Error Generic error in expression 20:46:07 Error in expression < %1 ", _insureSystem]; if(_insureSystem == 1) then { diag_log " Versichert !";> 20:46:07 Error position: <== 1) then { diag_log " Versichert !";> 20:46:07 Error Generic error in expression 20:46:07 " destroy vehicule !" 20:46:07 "insureSystem = [[],0] " 20:46:07 Error in expression < %1 ", _insureSystem]; if(_insureSystem == 1) then {
habe eben geschaut, aber finde den fehler wieder nicht...
Ich Verzweifel xDMfG
Wäre nice, wenn mir dabei nochmals jemand helfen könnte -
Ehm.... Welche Datei ist das? Bitte mal posten...
Auffallen tut mir grade einmal das:
destroy vehicule - da ist ein u zu viel drin
20:46:07 "insureSystem = [[],0] " Wieso ist "insureSystem" hier nicht als lokale Variable gekennzeichnet ("_insureSystem") -
Hab eben nachgeschaut,
der fehler ist glaube ich in der "life_server\FSM\cleanup.fsm"Code
Alles anzeigen/*%FSM<COMPILE "D:\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, Server-Side Cleanup">*/ /*%FSM<HEAD>*/ /* item0[] = {"init",0,250,-65.004578,-391.651611,24.995417,-341.651672,0.000000,"init"}; item1[] = {"true",8,218,-62.976639,-315.185364,27.023363,-265.185364,0.000000,"true"}; item2[] = {"Share__Work_load",2,250,-64.183350,-224.681931,25.816656,-174.681931,0.000000,"Share " \n "Work-load"}; item3[] = {"true",8,218,-54.709698,75.189262,35.290302,125.189262,0.000000,"true"}; item4[] = {"Time_Check",4,218,-219.425827,-133.310532,-129.425964,-83.310455,0.000000,"Time Check"}; item5[] = {"Delete_Dead_Cars",2,4346,-220.186951,-29.248400,-130.187195,20.751413,0.000000,"Delete" \n "Dead" \n "Cars"}; item6[] = {"",7,210,-312.538239,95.295059,-304.538239,103.295059,0.000000,""}; item7[] = {"",7,210,-311.750000,-203.033707,-303.750000,-195.033707,0.000000,""}; link0[] = {0,1}; link1[] = {1,2}; link2[] = {2,4}; link3[] = {3,6}; link4[] = {4,5}; link5[] = {5,3}; link6[] = {6,7}; link7[] = {7,2}; globals[] = {0.000000,0,0,0,0,640,480,1,46,6316128,1,-629.444153,611.207214,293.309357,-434.050568,1243,885,1}; window[] = {2,-1,-1,-1,-1,985,225,1868,225,3,1261}; *//*%FSM</HEAD>*/ class FSM { fsmName = "Server-Side Cleanup"; class States { /*%FSM<STATE "init">*/ class init { name = "init"; init = /*%FSM<STATEINIT""">*/"private[""_impound"",""_cars"",""_objs"",""_totCars"",""_thread""];" \n "_impound = time;" \n "_cars = time;" \n "_objs = time;"/*%FSM</STATEINIT""">*/; precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; class Links { /*%FSM<LINK "true">*/ class true { priority = 0.000000; to="Share__Work_load"; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/; action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; }; /*%FSM</LINK>*/ }; }; /*%FSM</STATE>*/ /*%FSM<STATE "Share__Work_load">*/ class Share__Work_load { name = "Share__Work_load"; init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/; precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; class Links { /*%FSM<LINK "Time_Check">*/ class Time_Check { priority = 0.000000; to="Delete_Dead_Cars"; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; condition=/*%FSM<CONDITION""">*/"((time - _cars) > (3 * 60))"/*%FSM</CONDITION""">*/; action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; }; /*%FSM</LINK>*/ }; }; /*%FSM</STATE>*/ /*%FSM<STATE "Delete_Dead_Cars">*/ class Delete_Dead_Cars { name = "Delete_Dead_Cars"; init = /*%FSM<STATEINIT""">*/"{" \n " if(!alive _x) then {" \n " _dbInfo = _x getVariable[""dbInfo"",[]];" \n " if(count _dbInfo > 0) then {" \n " _uid = _dbInfo select 0;" \n " _plate = _dbInfo select 1;" \n " _insureSystem = _dbInfo select 2;" \n " diag_log "" destroy vehicule !"";" \n " diag_log format[""insureSystem = %1 "", _insureSystem];" \n " if(_insureSystem == 1) then " \n " { " \n " diag_log "" Versichert !"";" \n " diag_log format[""insureSystem = %1 "", _insureSystem];" \n " _query_0 = format[""UPDATE vehicles SET alive='1', insure='0', active='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate]; " \n " _query_0 spawn " \n " {" \n " waitUntil {!DB_Async_Active};" \n " _thread_0 = [_this,1] spawn DB_fnc_asyncCall;" \n " };" \n " } " \n " else " \n " { " \n " diag_log "" Nicht Versichert !"";" \n " diag_log format[""insureSystem = %1 "", _insureSystem];" \n " _query = format[""UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate]; " \n " _query spawn " \n " {" \n " waitUntil {!DB_Async_Active};" \n " _thread = [_this,1] spawn DB_fnc_asyncCall;" \n " }; " \n " }; " \n " };" \n " if(!isNil ""_x"" && {!isNull _x}) then {" \n " deleteVehicle _x;" \n " };" \n " };" \n "} foreach allMissionObjects ""LandVehicle"";" \n "" \n "{" \n " if(!alive _x) then {" \n " _dbInfo = _x getVariable[""dbInfo"",[]];" \n " if(count _dbInfo > 0) then {" \n " _uid = _dbInfo select 0;" \n " _plate = _dbInfo select 1;" \n " _insureSystem = _dbInfo select 2;" \n " diag_log "" destroy vehicule !"";" \n " diag_log format[""insureSystem = %1 "", _insureSystem];" \n " if(_insureSystem == 1) then " \n " { " \n " diag_log "" Versichert !"";" \n " diag_log format[""insureSystem = %1 "", _insureSystem];" \n " _query_0 = format[""UPDATE vehicles SET alive='1', insure='0', active='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate]; " \n " _query_0 spawn " \n " {" \n " waitUntil {!DB_Async_Active};" \n " _thread_0 = [_this,1] spawn DB_fnc_asyncCall;" \n " };" \n " } " \n " else " \n " { " \n " diag_log "" Nicht Versichert !"";" \n " diag_log format[""insureSystem = %1 "", _insureSystem];" \n " _query = format[""UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate]; " \n " _query spawn " \n " {" \n " waitUntil {!DB_Async_Active};" \n " _thread = [_this,1] spawn DB_fnc_asyncCall;" \n " }; " \n " }; " \n " };" \n " if(!isNil ""_x"" && {!isNull _x}) then {" \n " deleteVehicle _x;" \n " };" \n " };" \n "} foreach allMissionObjects ""Air"";" \n "" \n "_cars = time;" \n "" \n "//Group cleanup." \n "{" \n " if(count units _x == 0 && local _x) then {" \n " deleteGroup _x;" \n " };" \n "} foreach allGroups;"/*%FSM</STATEINIT""">*/; precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; class Links { /*%FSM<LINK "true">*/ class true { priority = 0.000000; to="Share__Work_load"; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/; action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; }; /*%FSM</LINK>*/ }; }; /*%FSM</STATE>*/ }; initState="init"; finalStates[] = { }; }; /*%FSM</COMPILE>*/
-
Keiner, eine idee woran der fehler hier liegen könnte ?
@blackfisch @Shinji @nox @MotomboEvntl kann sich das von euch mal jemand anschauen, weil eine Datei steht in der RPT nicht drin.. also in was für einer Datei der Fehler sein soll...
-
Wenn du extdb2 nutzt, kann dass schon mal raus
waitUntil {!DB_Async_Active}; aus der kompletten fsmEhm.... Welche Datei ist das? Bitte mal posten...
Auffallen tut mir grade einmal das:
destroy vehicule - da ist ein u zu viel drin
20:46:07 "insureSystem = [[],0] " Wieso ist "insureSystem" hier nicht als lokale Variable gekennzeichnet ("_insureSystem")Weil es eine diag_log ist
Was mich viel mehr irritiert -> Deine Ausgabe der versicherung ist ziemlich strange...
20:46:07 "insureSystem = [[],0] " < diag_log.Code
Alles anzeigen_dbInfo = _x getVariable[""dbInfo"",[]]; if(count _dbInfo > 0) then { _uid = _dbInfo select 0; _plate = _dbInfo select 1; _insureSystem = _dbInfo select 2; diag_log "" destroy vehicule !""; diag_log format[""insureSystem = %1 "", _insureSystem]; if(_insureSystem == 1) then { diag_log "" Versichert !""; diag_log format[""insureSystem = %1 "", _insureSystem];
Irr ich mich oder ist deine dbInfo anders? normal -> [uid,plate,versicherung] Deine aber [[],0] ? Da stimmt was gewaltig nicht. Deine vehicleSpawn bzw. deine allgemeine dbInfo ist nicht korrekt.
Prüf das mal ab in den Dateien
vehicleSpawn vom server und das kaufen vom Vehicle im Client. Normal dürfte das nicht sein. -
Hey Leute,
Ich habe momentan folgendes Problem. Ich habe die Versicherung genau nach dem Tutorial eingefügt, doch nun bleiben die Fahrzeuge nach dem ausparken in der Garage, so dass man ein Fahrzeug welches man eigentlich nur ein einziges mal ausparken sollte, nun leider unendlich oft ausparken kann. Desweiteren gibt es in meinen .rpt logs als auch in den extDb2 logs keinen Fehler...Weiß jemand eventuell wo genau ich nach einem Fehler suchen soll? Bin Ratlos
-
Schau dir mal @Shinji Antwort oben an, genau das selbe hatte ich auch.
Wenn du es so machst wie er es erklärt funktioniert es.MfG
-
Danke für die schnelle Antwort. Das Problem ist nur das ich eigentlich schon alles gemacht habe. Ich bekomme ja auch in keinem Log mehr eine Fehlermeldung, dennoch verschwindet das Auto nach dem Ausparken nicht aus der Garage und man kann es immer weiter Ausparken. Außerdem ist mir aufgefallen das das Fahrzeug nur in der Garage gespeichert wird, in der es eingeparkt wurde. Das heißt, dass in allen anderen Garagen auf der Map das Fahrzeug bzw die Fahrzeuge nicht zu finden sind.
Habe auch die cleanup.fsm angepasst. Und alle waitUntil {!DB_Async_Active}; entfernt...
Deshalb bin ich ja so Ratlos :?
Es folgen die Dateien...
Code: fn_spawnVehicle.sqf
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"]; _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; _unit_return = _unit; _name = name _unit; _side = side _unit; _unit = owner _unit; if(EQUAL(_vid,-1) OR EQUAL(_pid,"")) 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 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") == 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(EQUAL(typeName _queryResult,typeName "")) exitWith {}; _vInfo = _queryResult; if(isNil "_vInfo") exitWith {serv_sv_use deleteAt _servIndex;}; if(EQUAL(count _vInfo,0)) exitWith {serv_sv_use deleteAt _servIndex;}; if(EQUAL(SEL(_vInfo,5),0)) exitWith { serv_sv_use deleteAt _servIndex; [1,format[(localize "STR_Garage_SQLError_Destroyed"),_vInfo select 2]] remoteExecCall ["life_fnc_broadcast",_unit]; }; if(EQUAL(SEL(_vInfo,6),1)) exitWith { serv_sv_use deleteAt _servIndex; [1,format[(localize "STR_Garage_SQLError_Active"),_vInfo select 2]] remoteExecCall ["life_fnc_broadcast",_unit]; }; if!(EQUAL(typeName _sp,typeName "")) 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,(localize "STR_Garage_SpawnPointError")] remoteExecCall ["life_fnc_broadcast",_unit]; }; _query = format["SELECT id, side, classname, type, pid, alive, active, plate, color, insure FROM vehicles WHERE id='%1' AND pid='%2'",_vid,_pid]; _trunk = [_vInfo select 9] call DB_fnc_mresToArray; _gear = [_vInfo select 10] call DB_fnc_mresToArray; [_query,false] spawn DB_fnc_asyncCall; if(typeName _sp == "STRING") 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]); sleep 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 setFuel (_vInfo select 11); _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, _vInfo select 9]]; _vehicle setVariable["Trunk",_trunk,true]; _vehicle disableTIEquipment true; //No Thermals.. They're cheap but addictive. [_vehicle] call life_fnc_clearVehicleAmmo; if (count _gear > 0) 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)]; }; }; //Sets of animations if(EQUAL(SEL(_vInfo,1),"civ") && EQUAL(SEL(_vInfo,2),"B_Heli_Light_01_F") && !(EQUAL(SEL(_vInfo,8),13))) then { [_vehicle,"civ_littlebird",true] remoteExecCall ["life_fnc_vehicleAnimate",_unit]; }; if(EQUAL(SEL(_vInfo,1),"cop") && (SEL(_vInfo,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(EQUAL(SEL(_vInfo,1),"med") && EQUAL(SEL(_vInfo,2),"C_Offroad_01_F")) then { [_vehicle,"med_offroad",true] remoteExecCall ["life_fnc_vehicleAnimate",_unit]; }; if(EQUAL(SEL(_vInfo,9), 1)) then { [1,"Ihr Fahrzeug ist versichert Ausgeparkt!"] remoteExecCall ["life_fnc_broadcast",_unit]; } else { [1,"Ihr Fahrzeug wurde ausgeparkt!"] remoteExecCall ["life_fnc_broadcast",_unit]; }; serv_sv_use deleteAt _servIndex;
Code: fn_vehicleCreate.sqf
Alles anzeigen/* File: fn_vehicleCreate.sqf Author: Bryan "Tonic" Boardwine Description: Answers the query request to create the vehicle in the database. */ private["_uid","_side","_type","_classname","_color","_plate","_insureSystem"]; _uid = [_this,0,"",[""]] call BIS_fnc_param; _side = [_this,1,sideUnknown,[west]] call BIS_fnc_param; _vehicle = [_this,2,ObjNull,[ObjNull]] call BIS_fnc_param; _color = [_this,3,-1,[0]] call BIS_fnc_param; _insureSystem = 0; //Error checks if(_uid == "" OR _side == sideUnknown OR isNull _vehicle) exitWith {}; if(!alive _vehicle) exitWith {}; _className = typeOf _vehicle; _type = switch(true) do { case (_vehicle isKindOf "Car"): {"Car"}; case (_vehicle isKindOf "Air"): {"Air"}; case (_vehicle isKindOf "Ship"): {"Ship"}; }; _side = switch(_side) do { case west:{"cop"}; case civilian: {"civ"}; case independent: {"med"}; default {"Error"}; }; _plate = round(random(1000000)); [_uid,_side,_type,_classname,_color,_plate] call DB_fnc_insertVehicle; _vehicle setVariable["dbInfo",[_uid,_plate,_insureSystem]]; _vehicle addEventHandler["Killed","_this spawn TON_fnc_vehicleDead"];
Code: cleanup.fsm
Alles anzeigen/*%FSM<COMPILE "D:\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, Server-Side Cleanup">*/ /*%FSM<HEAD>*/ /* item0[] = {"init",0,250,-65.004578,-391.651611,24.995417,-341.651672,0.000000,"init"}; item1[] = {"true",8,218,-62.976639,-315.185364,27.023363,-265.185364,0.000000,"true"}; item2[] = {"Share__Work_load",2,250,-64.183350,-224.681931,25.816656,-174.681931,0.000000,"Share " \n "Work-load"}; item3[] = {"true",8,218,-54.709698,75.189262,35.290302,125.189262,0.000000,"true"}; item4[] = {"Time_Check",4,218,-219.425827,-133.310532,-129.425964,-83.310455,0.000000,"Time Check"}; item5[] = {"Delete_Dead_Cars",2,4346,-220.186951,-29.248400,-130.187195,20.751413,0.000000,"Delete" \n "Dead" \n "Cars"}; item6[] = {"",7,210,-312.538239,95.295059,-304.538239,103.295059,0.000000,""}; item7[] = {"",7,210,-311.750000,-203.033707,-303.750000,-195.033707,0.000000,""}; link0[] = {0,1}; link1[] = {1,2}; link2[] = {2,4}; link3[] = {3,6}; link4[] = {4,5}; link5[] = {5,3}; link6[] = {6,7}; link7[] = {7,2}; globals[] = {0.000000,0,0,0,0,640,480,1,46,6316128,1,-629.444153,611.207214,293.309357,-434.050568,1243,885,1}; window[] = {2,-1,-1,-1,-1,985,225,1868,225,3,1261}; *//*%FSM</HEAD>*/ class FSM { fsmName = "Server-Side Cleanup"; class States { /*%FSM<STATE "init">*/ class init { name = "init"; init = /*%FSM<STATEINIT""">*/"private[""_impound"",""_cars"",""_objs"",""_totCars"",""_thread""];" \n "_impound = time;" \n "_cars = time;" \n "_objs = time;"/*%FSM</STATEINIT""">*/; precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; class Links { /*%FSM<LINK "true">*/ class true { priority = 0.000000; to="Share__Work_load"; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/; action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; }; /*%FSM</LINK>*/ }; }; /*%FSM</STATE>*/ /*%FSM<STATE "Share__Work_load">*/ class Share__Work_load { name = "Share__Work_load"; init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/; precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; class Links { /*%FSM<LINK "Time_Check">*/ class Time_Check { priority = 0.000000; to="Delete_Dead_Cars"; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; condition=/*%FSM<CONDITION""">*/"((time - _cars) > (3 * 60))"/*%FSM</CONDITION""">*/; action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; }; /*%FSM</LINK>*/ }; }; /*%FSM</STATE>*/ /*%FSM<STATE "Delete_Dead_Cars">*/ class Delete_Dead_Cars { name = "Delete_Dead_Cars"; init = /*%FSM<STATEINIT""">*/"{" \n " if(!alive _x) then {" \n " _dbInfo = _x getVariable[""dbInfo"",[]];" \n " if(count _dbInfo > 0) then {" \n " _uid = _dbInfo select 0;" \n " _plate = _dbInfo select 1;" \n " _insureSystem = _dbInfo select 2;" \n " diag_log "" destroy vehicle !"";" \n " diag_log format[""insureSystem = %1 "", _insureSystem];" \n " if(_insureSystem == 1) then " \n " { " \n " diag_log "" Versichert !"";" \n " diag_log format[""insureSystem = %1 "", _insureSystem];" \n " _query_0 = format[""UPDATE vehicles SET alive='1', insure='0', active='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate]; " \n " _query_0 spawn " \n " {" \n " _thread_0 = [_this,1] spawn DB_fnc_asyncCall;" \n " };" \n " } " \n " else " \n " { " \n " diag_log "" Nicht Verischert !"";" \n " diag_log format[""insureSystem = %1 "", _insureSystem];" \n " _query = format[""UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate]; " \n " _query spawn " \n " {" \n " _thread = [_this,1] spawn DB_fnc_asyncCall;" \n " }; " \n " }; " \n " };" \n " if(!isNil ""_x"" && {!isNull _x}) then {" \n " deleteVehicle _x;" \n " };" \n " };" \n "} foreach allMissionObjects ""LandVehicle"";" \n "" \n "{" \n " if(!alive _x) then {" \n " _dbInfo = _x getVariable[""dbInfo"",[]];" \n " if(count _dbInfo > 0) then {" \n " _uid = _dbInfo select 0;" \n " _plate = _dbInfo select 1;" \n " _insureSystem = _dbInfo select 2;" \n " diag_log "" destroy vehicle !"";" \n " diag_log format[""insureSystem = %1 "", _insureSystem];" \n " if(_insureSystem == 1) then " \n " { " \n " diag_log "" Versichert !"";" \n " diag_log format[""insureSystem = %1 "", _insureSystem];" \n " _query_0 = format[""UPDATE vehicles SET alive='1', insure='0', active='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate]; " \n " _query_0 spawn " \n " {" \n " _thread_0 = [_this,1] spawn DB_fnc_asyncCall;" \n " };" \n " } " \n " else " \n " { " \n " diag_log "" Nicht Versichert !"";" \n " diag_log format[""insureSystem = %1 "", _insureSystem];" \n " _query = format[""UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'"",_uid,_plate]; " \n " _query spawn " \n " {" \n " _thread = [_this,1] spawn DB_fnc_asyncCall;" \n " }; " \n " }; " \n " };" \n " if(!isNil ""_x"" && {!isNull _x}) then {" \n " deleteVehicle _x;" \n " };" \n " };" \n "} foreach allMissionObjects ""Air"";" \n "" \n "_cars = time;" \n "" \n "//Group cleanup." \n "{" \n " if(count units _x == 0 && local _x) then {" \n " deleteGroup _x;" \n " };" \n "} foreach allGroups;"/*%FSM</STATEINIT""">*/; precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; class Links { /*%FSM<LINK "true">*/ class true { priority = 0.000000; to="Share__Work_load"; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/; action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; }; /*%FSM</LINK>*/ }; }; /*%FSM</STATE>*/ }; initState="init"; finalStates[] = { }; }; /*%FSM</COMPILE>*/
Ich wäre Dankbar wenn mir jemand noch Hilfestellung geben könnte was ich Falsch gemacht habe bzw was mein Fehler ist. -
Ich bekomme ja auch in keinem Log mehr eine Fehlermeldung,
Ich kann es gar nicht oft genug sagen, bitte überlasst uns darüber zu urteilen ob und welche Fehler vorhanden sind in den Logs.
Daher bitte ich darum einfach die RPT`S des Clients sowie Servers und ganz wichtig, die von [lexicon]extDB[/lexicon] zu schicken.Sieht mir danach aus, dass er dir das Fahrzeug einfach beim ausparken nicht mehr auf active setzt.
BTW File durchgelesen, wie ich gedacht hab setzt er dir das Vehicle nicht mehr auf active.
_query = format["UPDATE vehicles SET active='1' WHERE pid='%1' AND id='%2'",_pid,_vid];Fehlt dir also. -> Tip: die Zeile ÜBER der hier
if(typeName _sp == "STRING") then {
-
Ich danke dir Shinji für die schnelle Antwort. Ich schick in Zukunft die Logs direkt mit.
Habe _query = format["UPDATE vehicles SET active='1' WHERE pid='%1' AND id='%2'",_pid,_vid]; hinzugefügt.
Gleichzeitig ist mir aufgefallen dass auch noch diese Zeile gefehlt hat:
_query = format["fuel FROM vehicles WHERE id='%1' AND pid='%2'",_vid,_pid];
MfG
LostInDreamZ -
@nox @Shinji @blackfisch
Hat jemand die Einzelne Datenbank.
Weil meine Datenbank sieht anders aus und ich würde gern nur:Hinzufügen...
Wäre Super, wenn mir da eben jemand helfen würde.
MfG
-