23.08.2016, 07:04
Hello. I have a problem with this. My crashdetect plugin print this:
This all show after a gmx command. Before restart all work's fine. This errors not load data from my database, is probably in this lines:
I using that functions in OnGamemodeInit. Anyone know what is this? Sry for my bad english.
Код:
[08:44:34] [debug] Run time error 5: "Invalid memory access" [08:44:34] [debug] AMX backtrace: [08:44:34] [debug] #0 00045654 in ?? (45516, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... <23 arguments>) from new.amx [08:44:34] [debug] #1 0002c8cc in ?? (45516, 82284, 32) from new.amx [08:44:34] [debug] #2 00031800 in public FJ37DH3JG_MYSQL_INTERNAL (7502824) from new.amx [08:44:34] [debug] Run time error 5: "Invalid memory access" [08:44:34] [debug] AMX backtrace: [08:44:34] [debug] #0 00047d2c in ?? (45536, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... <23 arguments>) from new.amx [08:44:34] [debug] #1 0002c8cc in ?? (45536, 82284, 32) from new.amx [08:44:34] [debug] #2 00031800 in public FJ37DH3JG_MYSQL_INTERNAL (7502824) from new.amx
Код:
public LoadVehicles() { new query[256]; inline OnLoadVehicles() { new rows = cache_get_row_count(), vehid, ORM:orm_id; for(new row = 0; row != rows; row++) { vehid = Iter_Alloc(Vehicle); orm_id = VehicleCache[vehid][vOrm] = orm_create("myrp_vehicles"); orm_addvar_int(orm_id, VehicleCache[vehid][vUID], "veh_uid"); orm_addvar_int(orm_id, VehicleCache[vehid][vModel], "veh_model"); orm_addvar_float(orm_id, VehicleCache[vehid][vPos][0], "veh_posx"); orm_addvar_float(orm_id, VehicleCache[vehid][vPos][1], "veh_posy"); orm_addvar_float(orm_id, VehicleCache[vehid][vPos][2], "veh_posz"); orm_addvar_float(orm_id, VehicleCache[vehid][vPos][3], "veh_posa"); orm_addvar_int(orm_id, VehicleCache[vehid][vCol][0], "veh_col1"); orm_addvar_int(orm_id, VehicleCache[vehid][vCol][1], "veh_col2"); orm_addvar_int(orm_id, VehicleCache[vehid][vInt], "veh_int"); orm_addvar_int(orm_id, VehicleCache[vehid][vWorld], "veh_world"); orm_addvar_int(orm_id, VehicleCache[vehid][vOwnerType], "veh_ownertype"); orm_addvar_int(orm_id, VehicleCache[vehid][vOwner], "veh_owner"); orm_setkey(orm_id, "veh_uid"); orm_apply_cache(orm_id, row); VehicleCache[vehid][vGID] = CreateVehicle(VehicleCache[vehid][vModel], VehicleCache[vehid][vPos][0], VehicleCache[vehid][vPos][1], VehicleCache[vehid][vPos][2], VehicleCache[vehid][vPos][3], VehicleCache[vehid][vCol][0], VehicleCache[vehid][vCol][1], 3600); } } mysql_format(MysqlHandle, query, sizeof(query), "SELECT * FROM `myrp_vehicles` WHERE veh_ownertype <> %d", OWNER_PLAYER); mysql_tquery_inline(MysqlHandle, query, using inline OnLoadVehicles, ""); return 1; }
Код:
public LoadGroups() { inline OnLoadGroups() { new rows = cache_get_row_count(), group_id, ORM:orm_id; for(new row = 0; row != rows; row++) { group_id = Iter_Alloc(Group); orm_id = GroupCache[group_id][gOrm] = orm_create("myrp_groups"); orm_addvar_int(orm_id, GroupCache[group_id][gUID], "group_uid"); orm_addvar_string(orm_id, GroupCache[group_id][gName], 32, "group_name"); orm_addvar_int(orm_id, GroupCache[group_id][gType], "group_type"); orm_addvar_int(orm_id, GroupCache[group_id][gCash], "group_cash"); orm_addvar_string(orm_id, GroupCache[group_id][gTag], 5, "group_tag"); orm_addvar_int(orm_id, GroupCache[group_id][gColor], "group_color"); orm_addvar_int(orm_id, GroupCache[group_id][gFlags], "group_flags"); orm_addvar_int(orm_id, GroupCache[group_id][gOwner], "group_owner"); orm_setkey(orm_id, "group_uid"); orm_apply_cache(orm_id, row); } } mysql_tquery_inline(MysqlHandle, "SELECT * FROM `myrp_groups`", using inline OnLoadGroups, ""); return 1; }