Raised This Month: $ Target: $400
 0% 

Array Help (Array 'Bumping' ?)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Drak
Veteran Member
Join Date: Jul 2005
Old 04-12-2009 , 16:58   Array Help (Array 'Bumping' ?)
Reply With Quote #1

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
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode