[Solved] GetServerVarAsInt + MAX_PLAYERS
#2

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");
}
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)