View Single Post
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 03-15-2019 , 09:03   Re: ArrayList size difference
Reply With Quote #4

Quote:
Originally Posted by _GamerX View Post
I using this

PHP Code:
ArrayList[MAXPLAYERS 1PlayerInfo;

    for(
int i 1<= MaxClientsi++)
        
PlayerInfo[i] = new ArrayList(5); 
MAXPLAYERS is a constant value, so I do not see any purposes of creating an array with dynamic length.
Just create fixed-length array.
PHP Code:
ArrayList PlayerInfo[MAXPLAYERS 1]; //Global variable

void OnPluginStart()  //Or somewhere else
{
    for(
int i 1<= MaxClientsi++)
    {
        
PlayerInfo[i] = new ArrayList(5);
    }


Last edited by impossible_cc; 03-15-2019 at 09:09.
impossible_cc is offline