Hallo,
ich habe das Problem das beim ersten versuch die Garage zu öffnen immer da steht keine Fahrzeuge.
Wenn man dann 3 Sekunden später nochmal versucht hat man Fahrzeuge in der garage.
Habe folgendes herausgefunden,
beim ersten Versuch:
Code
"pid: 7656*************"
"side: CIV"
"type: Car"
"unit: civ_3"
"query: SELECT id, side, classname, type, pid, alive, active, plate, color, insure FROM vehicles WHERE pid='7656*************' AND alive='1' AND active='0' AND side='civ' AND type='Car'"
"queryResult: <null>"
QueryResult ist null
5 Sekunden später Garage nochmal geöffnet:
Code
"pid: 7656*************"
"side: CIV"
"type: Car"
"unit: civ_3"
"query: SELECT id, side, classname, type, pid, alive, active, plate, color, insure FROM vehicles WHERE pid='7656*************' AND alive='1' AND active='0' AND side='civ' AND type='Car'"
"queryResult: [[34610,"civ","O_Truck_03_covered_F","Car","7656*************",1,0,70067,0,0],[34869,"civ","C_Offroad_01_F","Car","7656*************",1,0,60782,0,0],[36138,"civ","B_MRAP_01_F","Car","7656*************",1,0,467505,7,0],[37311,"civ","C_Hatchback_01_sport_F","Car","7656*************",1,0,416801,5,0],[37313,"civ","C_SUV_01_F","Car","7656*************",1,0,927455,3,0],[37385,"civ","C_Van_01_transport_F","Car","7656*************",1,0,759664,1,0],[37525,"civ","B_G_Offroad_01_F","Car","7656*************",1,0,803594,0,0],[41946,"civ","B_Quadbike_01_F","Car","7656*************",1,0,543312,2,0],[41947,"civ","B_Quadbike_01_F","Car","7656*************",1,0,73546,2,0],[41948,"civ","B_Quadbike_01_F","Car","7656*************",1,0,125261,1,0],[41949,"civ","B_Quadbike_01_F","Car","7656*************",1,0,667784,1,0],[41950,"civ","B_Quadbike_01_F","Car","7656*************",1,0,456664,1,0],[42008,"civ","C_Hatchback_01_sport_F","Car","7656*************",1,0,288233,8,1],[42557,"civ","C_SUV_01_F","Car","7656*************",1,0,191051,0,1]]"
Und aufmal habe ich Fahrzeuge in meiner Garage?
Liegt das an der MySQL Datenbank oder am Script?
Wie kann ich das beheben?
Falls gebraucht wird, fn_getVehicles:
Spoiler anzeigen
Code
#include "\life_server\script_macros.hpp"
/*
File: fn_getVehicles.sqf
Author: Bryan "Tonic" Boardwine
Description:
Sends a request to query the database information and returns vehicles.
*/
private["_pid","_side","_type","_unit","_ret","_tickTime","_queryResult"];
_pid = [_this,0,"",[""]] call BIS_fnc_param;
_side = [_this,1,sideUnknown,[west]] call BIS_fnc_param;
_type = [_this,2,"",[""]] call BIS_fnc_param;
_unit = [_this,3,ObjNull,[ObjNull]] call BIS_fnc_param;
diag_log format["pid: %1",_pid];
diag_log format["side: %1",_side];
diag_log format["type: %1",_type];
diag_log format["unit: %1",_unit];
//Error checks
if(_pid == "" OR _side == sideUnknown OR _type == "" OR isNull _unit) exitWith {
if(!isNull _unit) then {
[[]] remoteExecCall ["life_fnc_impoundMenu",(owner _unit)];
};
};
_unit = owner _unit;
_side = switch(_side) do {
case west:{"cop"};
case civilian: {"civ"};
case independent: {"med"};
default {"Error"};
};
if(_side == "Error") exitWith {
[[]] remoteExecCall ["life_fnc_impoundMenu",(owner _unit)];
};
_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];
diag_log format["query: %1",_query];
_tickTime = diag_tickTime;
_queryResult = [_query,2,true] call DB_fnc_asyncCall;
diag_log format["queryResult: %1",_queryResult];
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(typeName _queryResult == "STRING") exitWith {
[[]] remoteExecCall ["life_fnc_impoundMenu",(owner _unit)];
};
[_queryResult] remoteExecCall ["life_fnc_impoundMenu",_unit];
Alles anzeigen