Mysqd ID's
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
-
That's not how dynamic systems work though.
--
You could either:
1. Create a global variable and set the entrance ID to either true or false if it exists
pawn Код:
new bool: gValidEntrance[MAX_APTS] = {false, ...};

//when loading, load the Apartment ID:

new ID = cache_get_field_content_int(row, "Apartment_ID");

//then
gValidEntrance[ID] = true;

//whenever you attempt to enter a place:
for(new i = 0; i < MAX_APTS; i++)
{
    if(gValidEntrance[ID] == true)
    {
        //The entrance is now valid, shouldn't bug from now on
    }
}
2. Create a function to get the next empty ID
Reply


Messages In This Thread
Mysqd ID's - by edzis84 - 27.11.2013, 15:40
Re: Mysqd ID's - by Konstantinos - 27.11.2013, 15:43
Re: Mysqd ID's - by -Prodigy- - 27.11.2013, 16:41
Re: Mysqd ID's - by Konstantinos - 27.11.2013, 17:00

Forum Jump:


Users browsing this thread: 1 Guest(s)