Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- if (!alive _x) then {
- _dbInfo = _x getVariable["dbInfo", []];
- if (count _dbInfo > 0) then {
- _uid = _dbInfo select 0;
- _plate = _dbInfo select 1;
- _insureSystem = 1;
- if ((count _dbInfo) < 3) then {
- _insureSysten = 0;
- } else {
- _insureSystem = _dbInfo select 2;
- };
- diag_log "destroy vehicle!";
- diag_log format["insureSystem = %1", _insureSystem];
- if (_insureSystem == 1) then {
- diag_log "Insured!";
- diag_log format["insureSystem = %1", _insureSystem];
- _query_0 = format["UPDATE vehicles SET alive = '1', insure = '0', active = '0' WHERE pid = '%1' AND plate = '%2'", _uid, _plate];
- _query_0 spawn {
- _thread_0 = [_this, 1] call HC_fnc_asyncCall;
- };
- } else {
- diag_log "Not Insured!";
- _query = format["UPDATE vehicles SET alive = '0' WHERE pid = '%1' AND plate = '%2'", _uid, _plate];
- _query spawn {
- _thread = [_this, 1] call HC_fnc_asyncCall;
- };
- };
- };
- if (!isNil "_x" && {!isNull _x}) then {
- deleteVehicle _x;
- };
- } else {
- _dbInfo = _x getVariable["dbInfo", []];
- if ((count _dbInfo > 0) && ((count (crew _x)) < 1) && (_x getVariable ["knackbar",true])) then {
- _uid = _dbInfo select 0;
- _plate = _dbInfo select 1;
- if ((serverTime - (_x getVariable ["lastAcc", 1])) > 0) then {
- _nearUnits = nearestObjects [player, ["man"], 500];
- _ownerArray = _x getVariable ["vehicle_info_owners", []];
- _found = false;
- if (_x getVariable ["CopCar",false]) then {
- {
- if ((side _x) isEqualTo west) exitWith {
- _found = true;
- };
- } forEach _nearUnits;
- } else {
- {
- if ([(_x getVariable ["PID", -1]), _x getVariable ["realname",name player]] in _ownerArray) exitWith {
- _found = true;
- };
- } forEach _nearUnits;
- };
- if !(_found) then {
- _query_0 = format["UPDATE vehicles SET active = '0' WHERE pid = '%1' AND plate = '%2'", _uid, _plate];
- _query_0 spawn {
- _thread_0 = [_this, 1] call HC_fnc_asyncCall;
- };
- if (!isNil "_x" && {!isNull _x}) then {
- deleteVehicle _x;
- };
- };
- };
- };
- };
- } foreach allMissionObjects "LandVehicle";
- {
- if (!alive _x) then {
- _dbInfo = _x getVariable["dbInfo", []];
- if (count _dbInfo > 0) then {
- _uid = _dbInfo select 0;
- _plate = _dbInfo select 1;
- _insureSystem = 1;
- if ((count _dbInfo) < 3) then {
- _insureSysten = 0;
- } else {
- _insureSystem = _dbInfo select 2;
- };
- diag_log "destroy vehicule!";
- diag_log format["insureSystem = %1", _insureSystem];
- if (_insureSystem == 1) then {
- diag_log " Insured!";
- diag_log format["insureSystem = %1", _insureSystem];
- _query_0 = format["UPDATE vehicles SET alive = '1', insure = '0', active = '0' WHERE pid = '%1' AND plate = '%2'", _uid, _plate];
- _query_0 spawn {
- _thread_0 = [_this, 1] call HC_fnc_asyncCall;
- };
- } else {
- diag_log "Not Insured!";
- _query = format["UPDATE vehicles SET alive = '0' WHERE pid = '%1' AND plate = '%2'", _uid, _plate];
- _query spawn {
- _thread = [_this, 1] call HC_fnc_asyncCall;
- };
- };
- };
- if (!(isNil "_x") && {!isNull _x}) then {
- deleteVehicle _x;
- };
- } else {
- _dbInfo = _x getVariable["dbInfo", []];
- if ((count _dbInfo > 0) && ((count (crew _x)) < 1) && (_x getVariable ["knackbar",true])) then {
- _uid = _dbInfo select 0;
- _plate = _dbInfo select 1;
- if ((serverTime - (_x getVariable ["lastAcc", 1])) > 0) then {
- _nearUnits = nearestObjects [player, ["man"], 500];
- _ownerArray = _x getVariable ["vehicle_info_owners", []];
- _found = false;
- if (_x getVariable ["CopCar",false]) then {
- {
- if ((side _x) isEqualTo west) exitWith {
- _found = true;
- };
- } forEach _nearUnits;
- } else {
- {
- if ([(_x getVariable ["PID", -1]), _x getVariable ["realname",name player]] in _ownerArray) exitWith {
- _found = true;
- };
- } forEach _nearUnits;
- };
- if !(_found) then {
- _query_0 = format["UPDATE vehicles SET active = '0' WHERE pid = '%1' AND plate = '%2'", _uid, _plate];
- _query_0 spawn {
- _thread_0 = [_this, 1] call HC_fnc_asyncCall;
- };
- if (!isNil "_x" && {!isNull _x}) then {
- deleteVehicle _x;
- };
- };
- };
- };
- };
- } foreach allMissionObjects "Air";
- _cars = time;
- //Group cleanup.
- {
- if (((count units _x) == 0) && (local _x)) then {
- deleteGroup _x;
- };
- } foreach allGroups;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement