Sort enum ID
#1

Hello, I'm looking for a method to sort enumerators' IDs.
Example: Houses' enum have a limit of 500. I've created the houses ID 0, 1, 2, 3, 5, 10. Now I want that ID 5 became ID 4, and ID 10 became ID 5. All automatically, in a loop. How can I do?
Reply
#2

1. Set all house id array to -1 before creating in OnGameModeInit
2.
pawn Код:
for(new i = 0, id; i < MAX_HOUSES; i++)
{
    if(HouseInfo[i][hID] > -1)
        HouseInfo[i][hID] = id++;
}
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
1. Set all house id array to -1 before creating in OnGameModeInit
2.
pawn Код:
for(new i = 0, id; i < MAX_HOUSES; i++)
{
    if(HouseInfo[i][hID] > -1)
        HouseInfo[i][hID] = id++;
}
That's not what I mean.
Example:
I'm creating houses. Until now I have created 5 houses.
Enumerators' IDs are:
0, 1, 2, 3, 4, 5.
Now I delete House ID 3. I want that the ID 4 became ID 3, and ID 5 became ID 4, all in a loop.
For ID I mean HouseInfo[that id][....];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)