Moin,
da ich selbst momentan schlecht zum Testen komme stelle ich hier mal eine neue Version zur Verfügung. Eventuell kann die jemand mal testen und hier die Ergebnisse posten. Ich hatte gestern leider immer wieder das Phänomän, dass die Leichen mal sichtbar waren und dann wieder nicht.
C: fn_vehicleDead.sqf
/*
File: fn_vehicleDead.sqf
modified by moeck
Description:
Tells the database that this vehicle has died and can't be recovered.
*/
private["_vehicle","_plate","_uid","_query","_sql","_dbInfo","_thread"];
_vehicle = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
hint str _vehicle;
if(isNull _vehicle) exitWith {}; //NULL
_dbInfo = _vehicle getVariable["dbInfo",[]];
if(count _dbInfo == 0) exitWith {};
_uid = _dbInfo select 0;
_plate = _dbInfo select 1;
_query = format["UPDATE vehicles SET alive='0' WHERE pid='%1' AND plate='%2'",_uid,_plate];
waitUntil {!DB_Async_Active};
_thread = [_query,1] call DB_fnc_asyncCall;
//sleep (1.3 * 60);
if(!isNil "_vehicle" && {!isNull _vehicle}) then {
diag_log format["Vehicle are here %1" count _vehicle];
_dudes = crew _vehicle;
diag_log format["Dudes %1", count _dudes];
{
if !(alive _x) then
{
diag_log format["Dude %1, %2", getPlayerUID _x,_x getVariable["realname", name _x]];
/*_newPos = (getPos _vehicle) findEmptyPosition [(random 5), 10];
_handle = [[_x,_newPos,_vehicle],"TON_fnc_relocateDead",true,false] spawn life_fnc_MP;
waitUntil { scriptDone _handle };*/
moveOut _x;
unassignVehicle _x;
};
} forEach _dudes;
uisleep (1.3 * 60);
diag_log format["Delete %1", _vehicle];
deleteVehicle _vehicle;
};
Alles anzeigen
Ich habe jetzt mal ein paar Logausgaben mit eingebaut um einem Fehler auf die Spur zu kommen.
Gruß,
moeck