Raised This Month: $ Target: $400
 0% 

Solved loop entitys


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-16-2022 , 05:48   Re: loop entitys
Reply With Quote #1

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 strlen(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....
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 11-16-2022 at 14:40.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-16-2022 , 13:12   Re: loop entitys
Reply With Quote #2

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