Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Sandisk

#1
Support / Re: Vehicles ID's
Jun 10, 2023, 12:43 AM
Quote from: ! on Sep 18, 2017, 05:19 AMUse this function and then restart your server
function 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 this
UPDATE 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"