Sobald ich das Script eingebaut habe, sagt SpyGlass das ich nicht rauf kann hat jemand ne Idee
[Tutorial] Versichern von Fahrzeuge
-
- Altis Life
-
AmaZiinG -
16. August 2016 um 12:24
-
-
Spyglas Deaktivieren
-
es funktioniert alles aber das Fahrzeug ist nicht in der Garage nach dem Restart an was kann das liegen?
keine Fehler in den Logs -
Ich habe das Problem wenn ich das Fahrzeug versichere und ausparke dann ist meine DB ganz durcheinander. Und ich kann nichts mehr öffnen also keine Windows-Taste,Z-Menü,T-Inventar u.s.w.
Logs sind angehängt.
Sowie auch die fn_spawnVehicle.sqf und die fn_vehicleWeight.sqf -
Und wie funktioniert das ganze?
-
Hallo, ich habe das Problem,. dass Fahrzeuge die in der Garage waren versichert, ausgeparkt, eingeparkt werden können. allerdings speichert kein neues Fahrzeug mehr in der Garage. In der DB wird es auch nicht angezeigt. Bin das TuT jetzt 2 mal durchgegangen. Ich kann den Fehler nicht finden.
-
ersetzt die Zeile:
Codeif ((_vInfo select 14) isEqualTo 1) then { [1,"Votre véhicule est disponible et il est assuré!"] remoteExecCall ["life_fnc_broadcast",_unit]; }else{ [1,"Votre véhicule est disponible mais il n'est pas assuré!"] remoteExecCall ["life_fnc_broadcast",_unit]; }; serv_sv_use deleteAt _servIndex;
Sucht:
ersetzt die Zeile durch:
Sucht:
ersetzt die Zeile durch:Codeif ((_vInfo select 14) isEqualTo 1) then { [1,"Votre véhicule est disponible et il est assuré!"] remoteExecCall ["life_fnc_broadcast",_unit]; }else{ [1,"Votre véhicule est disponible mais il n'est pas assuré!"] remoteExecCall ["life_fnc_broadcast",_unit]; }; serv_sv_use deleteAt _servIndex;
5. life_server\FSM\cleanup.fsm ersetzt alles !:
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 "" Assurer !"";" \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] call DB_fnc_asyncCall;" \n " };" \n " } " \n " else " \n " { " \n " diag_log "" Pas Assurer !"";" \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] call 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 "" Assurer !"";" \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] call DB_fnc_asyncCall;" \n " };" \n " } " \n " else " \n " { " \n " diag_log "" Pas Assurer !"";" \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] call 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>*/
6. life_hc\FSM\cleanup.fsm ersetzt alles !
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 "" Assurer !"";" \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] call HC_fnc_asyncCall;" \n " };" \n " } " \n " else " \n " { " \n " diag_log "" Pas Assurer !"";" \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] call HC_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 "" Assurer !"";" \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] call HC_fnc_asyncCall;" \n " };" \n " } " \n " else " \n " { " \n " diag_log "" Pas Assurer !"";" \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] call HC_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>*/
7. life_server\functions\Systems\fn_getVehicles.sqf sucht nach:
Code_query = format["SELECT id, side, classname, type, pid, alive, active, plate, color FROM vehicles WHERE pid='%1' AND alive='1' AND active='0' AND side='%2' AND type='%3'",_pid,_side,_type];
und ersetzt es durch:
Code_query = format["SELECT id, side, classname, type, pid, alive, active, plate, color, insure FROM vehicles WHERE pid='%1' AND alive='1' AND active='0' AND side='%2' AND type='%3'",_pid,_side,_type];
8. life_hc\MySQL\Vehicles\fn_getVehicles.sqf
sucht nach:
Code_query = format["SELECT id, side, classname, type, pid, alive, active, plate, color FROM vehicles WHERE pid='%1' AND alive='1' AND active='0' AND side='%2' AND type='%3'",_pid,_side,_type];
ersetzt es durch:
Code_query = format["SELECT id, side, classname, type, pid, alive, active, plate, color, insure FROM vehicles WHERE pid='%1' AND alive='1' AND active='0' AND side='%2' AND type='%3'",_pid,_side,_type];
9. Fügt das in eure Datenbank ein:
10. Ladet den Versichernungs Ordner herunter und fügt die Dateien entsprechend ein.
ALTER TABLE `vehicles` ADD `insure` INT(1) NOT NULL DEFAULT '0';
Kannst du mir bitte verraten wie ich das in die DB einfügen soll? Wenn ich auf SQL gehe und dies einfüge und auf "Insert" klicke kommt ne Fehlermeldung mit nem roten x
-
Erstell einfach auf deinem Desktop ein Textdokument mit dem Inhalt und speichere die Datei als .SQL
Dann müsstest du über Import in deiner DB die Datei auswählen können, bin mir da aber gerade nicht sicher.
-