08.10.2015, 16:45
I have this problem and I don't know how to fix it.. Its older NGRP script and I don't know what is wrong or what is missing..
DynVeh_QueryFinish Codes
Код:
[16:42:06] [debug] Server crashed while executing NGRP.amx [16:42:06] [debug] AMX backtrace: [16:42:06] [debug] #0 native fclose () from samp03svr [16:42:06] [debug] #1 000dc118 in ?? (106344304, 127608456) from NGRP.amx [16:42:06] [debug] #2 000aaff4 in ?? (0) from NGRP.amx [16:42:06] [debug] #3 003dd3b8 in public DynVeh_QueryFinish (1, 0) from NGRP.amx [16:42:06] [debug] Native backtrace: [16:42:06] [debug] #0 e6e06e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so [16:42:06] [debug] #1 e6dffbcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so [16:42:06] [debug] #2 e6e00dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so [16:42:06] [debug] #3 e6e01226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so [16:42:06] [debug] #4 e6e06adc in ?? () from plugins/crashdetect.so [16:42:06] [debug] #5 e7514410 in ?? () [16:42:06] [debug] #6 e7514430 in ?? () [16:42:06] [debug] #7 e724a871 in gsignal () from /lib/libc.so.6 [16:42:06] [debug] #8 e724c14a in abort () from /lib/libc.so.6 [16:42:06] [debug] #9 e728a735 in ?? () from /lib/libc.so.6 [16:42:06] [debug] #10 e7290b91 in ?? () from /lib/libc.so.6 [16:42:06] [debug] #11 e72932f8 in ?? () from /lib/libc.so.6 [16:42:06] [debug] #12 e728070a in fclose () from /lib/libc.so.6 [16:42:06] [debug] #13 0809aa04 in ?? () from samp03svr [16:42:06] [debug] #14 08093d84 in ?? () from samp03svr [16:42:06] [debug] #15 e6e0294b in _ZN11CrashDetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so [16:42:06] [debug] #16 e6e058f8 in ?? () from plugins/crashdetect.so [16:42:06] [debug] #17 e6e09916 in amx_Exec () from plugins/crashdetect.so [16:42:06] [debug] #18 e6e01be6 in _ZN11CrashDetect9DoAmxExecEPii () from plugins/crashdetect.so [16:42:06] [debug] #19 e6e05659 in ?? () from plugins/crashdetect.so [16:42:06] [debug] #20 e6ebfca1 in amx_Exec () from plugins/mysql_static.so [16:42:06] [debug] #21 e6e9d860 in _ZN9CCallback16ProcessCallbacksEv () from plugins/mysql_static.so [16:42:06] [debug] #22 e6ec53b7 in ProcessTick () from plugins/mysql_static.so [16:42:06] [debug] #23 080cecf2 in ?? () from samp03svr [16:42:06] [debug] #24 080ace0c in ?? () from samp03svr [16:42:06] [debug] #25 080a81ae in ?? () from samp03svr [16:42:06] [debug] #26 e7236d36 in __libc_start_main () from /lib/libc.so.6 [16:42:06] [debug] #27 0804b4a1 in ?? () from samp03svr
Код:
forward LoadDynamicGroupVehicles(); public LoadDynamicGroupVehicles() { mysql_function_query(MainPipeline, "SELECT * FROM `groupvehs`", true, "DynVeh_QueryFinish", "ii", GV_QUERY_LOAD, 0); return 1; }
Код:
forward DynVeh_QueryFinish(iType, iExtraID); public DynVeh_QueryFinish(iType, iExtraID) { new iFields, iRows, iIndex, i = 0, sqlid, szResult[128]; cache_get_data(iRows, iFields, MainPipeline); switch(iType) { case GV_QUERY_LOAD: { format(szResult, sizeof(szResult), "UPDATE `groupvehs` SET `SpawnedID` = %d", INVALID_VEHICLE_ID); mysql_function_query(MainPipeline, szResult, false, "OnQueryFinish", "i", SENDDATA_THREAD); while((iIndex < iRows) && (iIndex < MAX_DYNAMIC_VEHICLES)) { cache_get_field_content(iIndex, "id", szResult, MainPipeline); sqlid = strval(szResult); if((sqlid >= MAX_DYNAMIC_VEHICLES)) {// Array bounds check. Use it. format(szResult, sizeof(szResult), "DELETE FROM `groupvehs` WHERE `id` = %d", sqlid); mysql_function_query(MainPipeline, szResult, false, "OnQueryFinish", "i", SENDDATA_THREAD); return printf("SQL ID %d exceeds Max Dynamic Vehicles", sqlid); } cache_get_field_content(iIndex, "gID", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_igID] = strval(szResult); cache_get_field_content(iIndex, "gDivID", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_igDivID] = strval(szResult); cache_get_field_content(iIndex, "fID", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_ifID] = strval(szResult); cache_get_field_content(iIndex, "rID", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_irID] = strval(szResult); cache_get_field_content(iIndex, "vModel", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_iModel] = strval(szResult); switch(DynVehicleInfo[sqlid][gv_iModel]) { case 538, 537, 449, 590, 569, 570: { DynVehicleInfo[sqlid][gv_iModel] = 0; } } cache_get_field_content(iIndex, "vPlate", DynVehicleInfo[sqlid][gv_iPlate], MainPipeline, 32); cache_get_field_content(iIndex, "vMaxHealth", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_fMaxHealth] = floatstr(szResult); cache_get_field_content(iIndex, "vType", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_iType] = strval(szResult); cache_get_field_content(iIndex, "vLoadMax", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_iLoadMax] = strval(szResult); if(DynVehicleInfo[sqlid][gv_iLoadMax] > 6) { DynVehicleInfo[sqlid][gv_iLoadMax] = 6; } cache_get_field_content(iIndex, "vCol1", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_iCol1] = strval(szResult); cache_get_field_content(iIndex, "vCol2", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_iCol2] = strval(szResult); cache_get_field_content(iIndex, "vX", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_fX] = floatstr(szResult); cache_get_field_content(iIndex, "vY", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_fY] = floatstr(szResult); cache_get_field_content(iIndex, "vZ", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_fZ] = floatstr(szResult); cache_get_field_content(iIndex, "vVW", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_iVW] = strval(szResult); cache_get_field_content(iIndex, "vInt", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_iInt] = strval(szResult); cache_get_field_content(iIndex, "vDisabled", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_iDisabled] = strval(szResult); cache_get_field_content(iIndex, "vRotZ", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_fRotZ] = floatstr(szResult); cache_get_field_content(iIndex, "vUpkeep", szResult, MainPipeline); DynVehicleInfo[sqlid][gv_iUpkeep] = strval(szResult); i = 1; while(i <= MAX_DV_OBJECTS) { format(szResult, sizeof szResult, "vAttachedObjectModel%i", i); cache_get_field_content(iIndex, szResult, szResult, MainPipeline); DynVehicleInfo[sqlid][gv_iAttachedObjectModel][i-1] = strval(szResult); format(szResult, sizeof szResult, "vObjectX%i", i); cache_get_field_content(iIndex, szResult, szResult, MainPipeline); DynVehicleInfo[sqlid][gv_fObjectX][i-1] = floatstr(szResult); format(szResult, sizeof szResult, "vObjectY%i", i); cache_get_field_content(iIndex, szResult, szResult, MainPipeline); DynVehicleInfo[sqlid][gv_fObjectY][i-1] = floatstr(szResult); format(szResult, sizeof szResult, "vObjectZ%i", i); cache_get_field_content(iIndex, szResult, szResult, MainPipeline); DynVehicleInfo[sqlid][gv_fObjectZ][i-1] = floatstr(szResult); format(szResult, sizeof szResult, "vObjectRX%i", i); cache_get_field_content(iIndex, szResult, szResult, MainPipeline); DynVehicleInfo[sqlid][gv_fObjectRX][i-1] = floatstr(szResult); format(szResult, sizeof szResult, "vObjectRY%i", i); cache_get_field_content(iIndex, szResult, szResult, MainPipeline); DynVehicleInfo[sqlid][gv_fObjectRY][i-1] = floatstr(szResult); format(szResult, sizeof szResult, "vObjectRZ%i", i); cache_get_field_content(iIndex, szResult, szResult, MainPipeline); DynVehicleInfo[sqlid][gv_fObjectRZ][i-1] = floatstr(szResult); i++; } i = 0; while(i < MAX_DV_MODS) { format(szResult, sizeof szResult, "vMod%i", i); cache_get_field_content(iIndex, szResult, szResult, MainPipeline); DynVehicleInfo[sqlid][gv_iMod][i++] = strval(szResult); } if(400 < DynVehicleInfo[sqlid][gv_iModel] < 612) { if(!IsWeaponizedVehicle(DynVehicleInfo[sqlid][gv_iModel])) { DynVeh_Spawn(iIndex); //printf("[DynVeh] Loaded Dynamic Vehicle %i.", iIndex); for(i = 0; i != MAX_DV_OBJECTS; i++) { if(DynVehicleInfo[sqlid][gv_iAttachedObjectModel][i] == 0 || DynVehicleInfo[sqlid][gv_iAttachedObjectModel][i] == INVALID_OBJECT_ID) { DynVehicleInfo[sqlid][gv_iAttachedObjectID][i] = INVALID_OBJECT_ID; DynVehicleInfo[sqlid][gv_iAttachedObjectModel][i] = INVALID_OBJECT_ID; } } } else { DynVehicleInfo[sqlid][gv_iSpawnedID] = INVALID_VEHICLE_ID; } } iIndex++; } } } return 1; }