14.01.2010, 02:03
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:
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");
}