Raised This Month: $ Target: $400
 0% 

Solved loop entitys


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-16-2022 , 13:12   Re: loop entitys
Reply With Quote #1

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
Reply



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 15:43.


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