[ MySQL ] AI Problem
#1

I created a house system in MySQL and everything works just fine, let's say I created 5 houses, so it goes like this:

PHP Code:
hSQLID 1
hSQLID 
2
hSQLID 
3
hSQLID 
4
hSQLID 

Now I delete hSQLID = 3, and the next time I create a house hSQLID = 6, so how to fix that thing so it finds the free hSQLID and puts the house there ( and maybe resets the AI if thats necessary )
Reply
#2

The primary key is probably set to auto increment, have it the other way.
One option would be setting the ID manually from pawn, or maybe create a trigger on your table and have it handle the insertion.
Reply
#3

Quote:
Originally Posted by Eoussama
View Post
Setting the ID manually from pawn, or maybe create a trigger on your table and have it handle the insertion.
Question is how?
Reply
#4

Anyone?
Reply
#5

Quote:
Originally Posted by Y_Less
View Post
The question is why? That's not what SQL IDs are for, and realistically you shouldn't be deleting anything in your database. Just mark things as unneeded.
Well when I get hSQLID = 6, and I delete it ingame it doenst delete on the database beacuse it deletes the ID of the vehicle... so should I just delete it by their SQLID-s not by IN-game IDs?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)