[ MySQL ] AI Problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [ MySQL ] AI Problem (
/showthread.php?tid=660518)
[ MySQL ] AI Problem -
IdonTmiss - 05.11.2018
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 = 5
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 )
Re: [ MySQL ] AI Problem -
Eoussama - 05.11.2018
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.
Re: [ MySQL ] AI Problem -
IdonTmiss - 05.11.2018
Quote:
Originally Posted by Eoussama
Setting the ID manually from pawn, or maybe create a trigger on your table and have it handle the insertion.
|
Question is how?
Re: [ MySQL ] AI Problem -
IdonTmiss - 05.11.2018
Anyone?
Re: [ MySQL ] AI Problem -
IdonTmiss - 05.11.2018
Quote:
Originally Posted by Y_Less
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?