Thread: [Solved] loop entitys
View Single Post
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-16-2022 , 13:12   Re: loop entitys
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
Why don't you initiate the array as the following it will be less complex and easier to understand .

PHP Code:

#define MAX_WARRIORS_TYPES      3
#define MAX_ENT_PER_WARRIOR    4

new __int_TransEnts[MAX_PLAYERS+1][MAX_WARRIORS_TYPES][MAX_ENT_PER_WARRIOR]


RemovePlayerTransEntitiesidWarriorType )
{
     for(new 
iMAX_ENT_PER_WARRIORi++)
     {
              if( 
__int_TransEnts[id][WarriorType][i] > )
              {
                       
remove_entity(__int_TransEnts[id][WarriorType][i]);
                       
__int_TransEnts[id][WarriorType][i] = 0;
              }
      }
}
RemovePlayerTransEntitiesByArrayidWarriorType, const Array[] )
{
     for(new 
ijsizeofArray sizeof Array; MAX_ENT_PER_WARRIORi++)
     {
           for(
0sizeofArrayj++)
           {
              if( 
__int_TransEnts[id][WarriorType][i] == Array[j]  )
              {
                       
remove_entity(__int_TransEnts[id][WarriorType][i]);
                       
__int_TransEnts[id][WarriorType][i] = 0;
                       break;
              }
            }
      }

Again it will be much simpler if you explained what are you trying to achieve....
First of all, the code you wrote has nothing to do with what I did, second, I already solved it 1000 times simpler than that, I see that in all the posts you don't understand such simple things, and not only mine.

Last edited by MrPickles; 11-16-2022 at 13:15.
MrPickles is offline