SaveCar(vehicleid) { new Query[5024], Float:Pos[4], neni, doors, Float:vhp, panels, doors1, lights, tires,ts[14]; printf("1"); GetVehicleDamageStatus(vehicleid, panels, doors1, lights, tires); printf("2"); GetVehicleParamsEx(vehicleid, neni, neni, neni, doors, neni, neni, neni); printf("3"); GetVehicleHealth(vehicleid, vhp); printf("4"); GetVehiclePos(vehicleid, Pos[0], Pos[1], Pos[2]); GetVehicleZAngle(vehicleid, Pos[3]); for(new i; i < 13; i++) ts[i] = GetVehicleComponentInSlot(vehicleid, i); printf("5"); format(Query,5024,"UPDATE `cars` SET `x` = '%f', `y` = '%f', `z` = '%f', `a` = '%f', `vw` = '%d', `inter` = '%d', `far1` = '%d', `far2` = '%d',",Pos[0],Pos[1],Pos[2],Pos[3],GetVehicleVirtualWorld(vehicleid), 0, vehicle[vehicleid][FARBA1],vehicle[vehicleid][FARBA2]); printf("6"); format(Query,5024,"%s`km` = '%f', `fuel` = '%d', `battery` = '%d', `vlock` = '%d', vhp = '%f', panels = '%d', doors = '%d', lights = '%d', tires = '%d', ts0 = '%d', ts1 = '%d', ts2 = '%d', ts3 = '%d', ts4 = '%d', ts5 = '%d', ts6 = '%d', ts7 = '%d', ts8 = '%d', ts9 = '%d', ts10 = '%d', ts11 = '%d', ts12 = '%d', ts13 = '%d', paintjob = '%d', tanked = '%d',tovar='%d',tovartyp='%d',radio='%d' WHERE spz = '%s'", Query,vehicle[vehicleid][KILOMETER],vehicle[vehicleid][FUEL],vehicle[vehicleid][BATTERY],doors,vhp,panels,doors1,lights,tires,ts[0],ts[1],ts[2],ts[3],ts[4],ts[5],ts[6],ts[7],ts[8],ts[9],ts[10],ts[11],ts[12],ts[13],vehicle[vehicleid][PAINTJOB], vehicle[vehicleid][TANKED], vehicle[vehicleid][TOVAR],vehicle[vehicleid][TOVARTYPE],vehicle[vehicleid][RADIO],vehicle[vehicleid][SPZ]); printf("7"); mysql_query(Query); printf("8"); mysql_free_result(); printf("9"); SetTimerEx("DestroyCar", 2000, false, "i", vehicleid); return 1; }
SaveCar(vehicleid) { new Query[5024], Float:Pos[4], neni, doors, Float:vhp, panels, doors1, lights, tires,ts[14]; printf("1"); GetVehicleDamageStatus(vehicleid, panels, doors1, lights, tires); printf("2"); GetVehicleParamsEx(vehicleid, neni, neni, neni, doors, neni, neni, neni); printf("3"); GetVehicleHealth(vehicleid, vhp); printf("4"); GetVehiclePos(vehicleid, Pos[0], Pos[1], Pos[2]); GetVehicleZAngle(vehicleid, Pos[3]); for(new i; i < 13; i++) ts[i] = GetVehicleComponentInSlot(vehicleid, i); printf("5"); format(Query,5024,"UPDATE `cars` SET `x` = '%f', `y` = '%f', `z` = '%f', `a` = '%f', `vw` = '%d', `inter` = '%d', `far1` = '%d', `far2` = '%d',",Pos[0],Pos[1],Pos[2],Pos[3],GetVehicleVirtualWorld(vehicleid), 0, vehicle[vehicleid][FARBA1],vehicle[vehicleid][FARBA2]); printf("6"); new Query1[5024]; strcat(Query1, Query); format(Query,5024,"`km` = '%f', `fuel` = '%d', `battery` = '%d', `vlock` = '%d', vhp = '%f', panels = '%d', doors = '%d', lights = '%d', tires = '%d', ts0 = '%d', ts1 = '%d', ts2 = '%d', ts3 = '%d', ts4 = '%d', ts5 = '%d', ts6 = '%d', ts7 = '%d', ts8 = '%d', ts9 = '%d', ts10 = '%d', ts11 = '%d', ts12 = '%d', ts13 = '%d', paintjob = '%d', tanked = '%d',tovar='%d',tovartyp='%d',radio='%d' WHERE spz = '%s'", vehicle[vehicleid][KILOMETER],vehicle[vehicleid][FUEL],vehicle[vehicleid][BATTERY],doors,vhp,panels,doors1,lights,tires,ts[0],ts[1],ts[2],ts[3],ts[4],ts[5],ts[6],ts[7],ts[8],ts[9],ts[10],ts[11],ts[12],ts[13],vehicle[vehicleid][PAINTJOB], vehicle[vehicleid][TANKED], vehicle[vehicleid][TOVAR],vehicle[vehicleid][TOVARTYPE],vehicle[vehicleid][RADIO],vehicle[vehicleid][SPZ]); strcat(Query1, Query); printf("7"); mysql_query(Query1); printf("8"); mysql_free_result(); printf("9"); SetTimerEx("DestroyCar", 2000, false, "i", vehicleid); return 1; }
- this is my new code, it is still printing just "1" in the console, nothing else.
|
[11:57:27] [debug] Run time error 4: "Array index out of bounds" [11:57:27] [debug] Accessing element at index 65535 past array upper bound 1999 [11:57:27] [debug] AMX backtrace: [11:57:27] [debug] #0 0002d9f4 in ?? (4936108) from clrp.amx [11:57:27] [debug] #1 0004fad0 in ?? (0) from clrp.amx [11:57:27] [debug] #2 0007ba30 in public OnDialogResponse (0, 1, 1, -1, 16854984) from clrp.amx [11:58:16] RCON (In-Game): Player [Bastiaan_Viltuautas] sent command: login **** [11:58:17] RCON (In-Game): Player [Bastiaan_Viltuautas] sent command: gmx [11:58:17] 1 [11:58:17] [debug] Run time error 3: "Stack/heap collision (insufficient stack size)" [11:58:17] [debug] Stack pointer (STK) is 0x10120F0, heap pointer (HEA) is 0x1012FC8 [11:58:17] [debug] AMX backtrace: [11:58:17] [debug] #0 000565f8 in public CB_OnPlayerDisconnect (0, 1) from clrp.amx [11:58:17] [debug] #1 00007ef8 in public SSCANF_OnPlayerDisconnect (0, 1) from clrp.amx [11:58:17] [debug] #2 000005b4 in public OnPlayerDisconnect (0, 1) from clrp.amx [11:58:17] MapFix by Nexius v2.4.8 unloaded.
new Float:Pos[4], neni, doors, Float:vhp, panels, doors1, lights, tires,ts[14];
static Query[450] = "UPDATE cars SET x=%f,y=%f,z=%f,a=%f,vw=%d,inter=%d,far1=%d,far2=%d," \
"km=%f,fuel=%d,battery=%d,vlock=%d,vhp=%f,panels=%d,doors=%d,lights=%d,tires=%d,ts0=%d,ts1=%d, ts2=%d,ts3=%d,ts4=%d,ts5=%d,ts6=%d,ts7=%d,ts8=%d,ts9=%d,ts10=%d,ts11=%d,ts12=%d,ts13=%d,paintjob=%d,tanked=%d,tovar=%d,tovartyp=%d,radio=%d WHERE spz='%s'";
format(Query, sizeof Query, Query,
Pos[0],Pos[1],Pos[2],Pos[3],GetVehicleVirtualWorld(vehicleid), 0, vehicle[vehicleid][FARBA1],vehicle[vehicleid][FARBA2],
vehicle[vehicleid][KILOMETER],vehicle[vehicleid][FUEL],vehicle[vehicleid][BATTERY],doors,vhp,panels,doors1,lights,tires,ts[0],ts[1],ts[2],ts[3],ts[4],ts[5],ts[6],ts[7],ts[8],ts[9],ts[10],ts[11],ts[12],ts[13],vehicle[vehicleid][PAINTJOB], vehicle[vehicleid][TANKED], vehicle[vehicleid][TOVAR],vehicle[vehicleid][TOVARTYPE],vehicle[vehicleid][RADIO],vehicle[vehicleid][SPZ]);