Raised This Month: $ Target: $400
 0% 

Solved loop entitys


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-15-2022 , 21:23   loop entitys
Reply With Quote #1

hi, i wanted to know how can i loop these entitys, i wanted to remove it, and reeplace the setentremove function

here is my actual code
PHP Code:
remove_entsClientWarrior )
{
          switch(
Warrior)
          {
                case 
0:
                {
                             
setEntRemove__int_TransEnts[Client][0] );
                             
setEntRemove__int_TransEnts[Client][1] ); 
                             
setEntRemove__int_TransEnts[Client][2] ); 

                             
// here will go the loop function
                
}
                case 
1:
                {
                             
setEntRemove__int_TransEnts[Client][0] );
                             
setEntRemove__int_TransEnts[Client][4] ); 
                             
setEntRemove__int_TransEnts[Client][3] ); 
                }
                case 
2:
                {
                             
setEntRemove__int_TransEnts[Client][6] ); 
                             
setEntRemove__int_TransEnts[Client][5] );
                             
setEntRemove__int_TransEnts[Client][4] ); 
                             
setEntRemove__int_TransEnts[Client][3] ); 
                }
         }
}
// make a loop function
setEntRemove( &Entity )
{
     if(
is_valid_ent(Entity))
     {
         
remove_entityEntity );
         
Entity 0;
     }


Edit. Solution:

PHP Code:

removeTransEnts
(Client__int_Entitys[] )  
{
        for( new 
0__int_Entitys[i] < 100i++)
        { 
              if(
is_valid_ent(__int_TransEnts[Client][__int_Entitys[i]]))
              {
                    
remove_entity__int_TransEnts[Client][__int_Entitys[i]] );
                    
__int_TransEnts[Client][__int_Entitys[i]] = 0;
                    
client_printClientprint_chat"Entity Removed = [Client][%d]"__int_Entitys[i] );

              }
              
client_printClientprint_chat"Entity Checked = [Client][%d]"__int_Entitys[i] );             
        }
}
remove_entsClientWarrior )
{
          switch(
Warrior)
          {
                case 
0:
                {
                             
removeTransEntsClient, {0,1,2,100} );

                             
// here will go the loop function
                
}
                case 
1:
                {
                             
removeTransEntsClient, {0,4,3,100} );
                }
                case 
2:
                {
                             
removeTransEntsClient, {6,5,4,3,100} );
                }
         }


Last edited by MrPickles; 11-17-2022 at 20:05.
MrPickles is offline
 


Thread Tools
Display Modes

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