[Solved] GetServerVarAsInt + MAX_PLAYERS
#3

Quote:
Originally Posted by ev0lutionnn
You can, but that means every time you make a reference to SLOTS in your gamemode, GetServerVarAsInt will be called.
That's slower than just using a variable/define, and useless because maxplayers can't change while the server is running, so you're constantly calling GetServerVarAsInt for the same value.

It'd be easier and faster to do this:
pawn Код:
new SLOTS;

public OnGameModeInit() {
  SLOTS = GetServerVarAsInt("maxplayers");
}
That won't work when creating variables. If accessing your script isn't a big deal then just add
pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 32
Reply


Messages In This Thread
[Solved] GetServerVarAsInt + MAX_PLAYERS - by Miguel - 14.01.2010, 01:21
Re: GetServerVarAsInt + MAX_PLAYERS - by ev0lution - 14.01.2010, 02:03
Re: GetServerVarAsInt + MAX_PLAYERS - by Joe Staff - 14.01.2010, 03:07
Re: GetServerVarAsInt + MAX_PLAYERS - by Miguel - 14.01.2010, 15:24

Forum Jump:


Users browsing this thread: 1 Guest(s)