Array Help (Array 'Bumping' ?)
Code:
enum STUFF
{
STUFF_1,
STUFF_2
}
new g_UserIDs[33]
new g_Stuff[33][33][STUFF]
Print(id)
{
g_Stuff[id][0][STUFF_1] = 1
g_Stuff[id][1][STUFF_1] = 2
g_Stuff[id][2][STUFF_1] = 3
g_Stuff[id][3][STUFF_1] = 4
// We have 4 id's
g_UserIDs[id] = 4
for(new Count;Count < g_UserIDs[id];Count++)
server_print("ID: %d - Count: %d",g_Stuff[id][Count][STUFF_1],Count);
}
The output of "server_print" would be
Code:
ID: 1 - Count: 0
ID: 2 - Count: 1
ID: 3 - Count: 2
ID: 4 - Count: 3
I want to remove the 'id' '1' so the output would be like:
Code:
ID: 2 - Count: 0
ID: 3 - Count: 1
ID: 4 - Count: 2
But how can i do this? I tried something like this:
Code:
RemoveID(id,Id2Remove)
{
for(new Count;Count < g_UserIDs[id];Count++)
{
if(g_Stuff[id][Count][STUFF_1] = Id2Remove)
{
g_Stuff[id][Count][STUFF_1] = 0
g_UserIDs[id] -= 1
}
}
}
But that didn't work
|