SA-MP Forums Archive
Deletion of a dynamic door [MySQL] - 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: Deletion of a dynamic door [MySQL] (/showthread.php?tid=453509)



Deletion of a dynamic door [MySQL] - Shockey HD - 25.07.2013

When deleting a dynamic door, I want to have the whole column 'doorid' to be reset to 0, then re auto increment every row. Would that be possible?


AW: Deletion of a dynamic door [MySQL] - NaS - 25.07.2013

Well, you have to drop the column and then re-add it. But in general, I would not change the auto_increment values (for safety reasons).
(There is a way do directly change it, can't remember now).

You can do, that the auto_increment value is only an 'internal value', to make sure every row is unique.
Then it doesn't even matter if 'doorid' is 1000000 or 23.

I guess you load the dynamic doors in an array in OnGameModeInit, you can use another ID for the Script (just counting up).

EDIT: Well I think you wont have too many doors that the IDs will go extremely high, also, are there references with other tables?