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"
#2
the reject cmd gives errors i think it must be as this:

else if ( cmd == "reject")
{
 if( stats[player.ID].Partner == "" ) return MessagePlayer("You haven't recieved any team-up request yet.",player);
 local plr = FindPlayer(stats[player.ID].Partner);

            MessagePlayer(""+rpmsg+"-> You rejected [#" + format("%02X%02X%02X", plr.Color.r, plr.Color.g, plr.Color.b) + "]"+plr.Name+""+rpmsg+"'s team-up request.",player);
            MessagePlayer(""+rpmsg+"-> [#" + format("%02X%02X%02X", plr.Color.r, plr.Color.g, plr.Color.b) + "]"+player.Name+" "+rpmsg+"rejected your team-up request. ",plr);
  stats[player.ID].Partner = "";
  stats[player.ID].Requested = false;
}