Raised This Month: $ Target: $400
 0% 

Clone dynamic array


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DavidLin
Member
Join Date: Jan 2016
Old 01-31-2016 , 12:18   Re: Clone dynamic array
Reply With Quote #3

The temp array is
new Array:Boxes;

And the main array is SupplyBoxes which is filled when plugin starts. The spawn event is made after some time from round start. I came up with a temporary solution but I think it isn't efficient ( to push main arrays items to temp by a loop ).

PHP Code:
        new Float:Orig], Float:Angl];
        new 
AmountCvar   get_pcvar_numcvar_amountSpawn );
        new 
ArraySizeBox ArraySizeSupplyBoxes );
        new 
size = ( AmountCvar == || AmountCvar ArraySizeBox ) ? ArraySizeBox AmountCvar;
        new 
DataSupplyBoxesArray ];
        new 
countrandomId;
        new Array:
Boxes ArrayCreateSupplyBoxesArray );
        for( new 
index 0index ArraySizeBoxindex++ ) {
                
ArrayGetArraySupplyBoxesindexData );
                
ArrayPushArrayBoxesData );
        }

        do {
                
randomId randomArraySizeBox );
                
ArrayGetArrayBoxesrandomIdData );
                
Orig] = Databox_origin ][ ]; Angl] = Databox_angles ][ ];
                
Orig] = Databox_origin ][ ]; Angl] = Databox_angles ][ ];
                
Orig] = Databox_origin ][ ]; Angl] = Databox_angles ][ ];
                
spawnSupplyBoxOrigAnglDataline_id ] );
                
count++;

                
ArrayDeleteItemBoxesrandomId );
                
ArraySizeBox--;
        } while( 
count size ); 
DavidLin is offline
 



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 09:23.


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