[Tutorial] Set Max Players to Server's Max Players
#2

I'd be careful doing it this way.
If you create variables that use "MAX_PLAYERS" as array size (which 99% of all scripts do), you are going create a variable with an array size of "0".
Either you have to define it as "new MAX_PLAYERS = 500;" or whichever value you would like to use, or easiest, just re-define MAX_PLAYERS hardcoded with your amount of max player slots


Example:
Код:
new MAX_PLAYERS;
new PlayerLevel[MAX_PLAYERS];  //MAX_PLAYERS is = 0 at this point

public OnGameModeInit()
{
    MAX_PLAYERS = GetMaxPlayers();  //This will change the value assigned to 'MAX_PLAYERS' but it will not change the array dimension of 'PlayerLevel'
    return 1;
}
Reply


Messages In This Thread
Changing MAX_PLAYERS value & Another way to loop. - by illuminati2 - 04.03.2016, 20:11
Re: Set Max Players to Server's Max Players - by Sascha - 04.03.2016, 20:25
Re: Set Max Players to Server's Max Players - by illuminati2 - 04.03.2016, 20:36
Re: Set Max Players to Server's Max Players - by Sascha - 04.03.2016, 20:52
Re: Set Max Players to Server's Max Players - by Crayder - 04.03.2016, 20:57
Re: Set Max Players to Server's Max Players - by illuminati2 - 04.03.2016, 20:58
Re: Set Max Players to Server's Max Players - by AndySedeyn - 05.03.2016, 06:58

Forum Jump:


Users browsing this thread: 1 Guest(s)