Quote from: ! on Sep 18, 2017, 05:19 AMUse this function and then restart your serverCode Selectfunction ResetIDs()
{
local q = QuerySQL(db,"SELECT ID FROM Vehicles"), i = 1;
while( GetSQLColumnData( q, 0 ) != null )
{
QuerySQL(db"UPDATE Vehicles SET ID='"+i+"' WHERE ID='"+GetSQLColumnData(q,0)+"'");
i++;
GetSQLNextRow( q );
}
FreeQuery( q );
print("Vehicles Loaded - "+i);
}
:edit:
P.S: After using above function don't use thisCode SelectUPDATE Vehicles SET ID = rowid
Cause it will change the ids to the one used upon INSERT
myproblem: when i create a vehicle in the server it spawns with 243 id when i restart the server it changes into 68 id
so the id 68 is not in the database so i got errors
this function doesn't work and doesn't change the ids in the database
console : "[SCRIPT] Vehicles Count (69)
[SCRIPT] Vehicles Loaded - 1"