I'm trying to make a few arrays that should be at least as big as the number of players. I could just use a constant so high that I doubt there would be a server with that many people (64?), but that would be a waste of memory and not really proper.
Note: I'm not error checking to see if the number of max clients is changed, and I don't care.
Code:
94: new Server_Max_Players = GetMaxClients() +1
...
104: new Float:gPlayerSwitchedTeam[Server_Max_Players]
105: new gGrieferTeam[Server_Max_Players]
106: new String:gGrieferClientID[Server_Max_Players][64]
107: new gBlocksUnfrozen[Server_Max_Players]
108: new Float:gTimeOfLastUnfreeze[Server_Max_Players]
However, I get errors:
Quote:
freezestatus.sp(94) : error 010: invalid function or declaration
freezestatus.sp(94) : error 008: must be a constant expression; assumed zero
freezestatus.sp(104) : error 008: must be a constant expression; assumed zero
freezestatus.sp(105) : error 008: must be a constant expression; assumed zero
freezestatus.sp(106) : error 008: must be a constant expression; assumed zero
freezestatus.sp(107) : error 008: must be a constant expression; assumed zero
freezestatus.sp(108): error 009: invalid array size (negative, zero or out of bounds)
|
if I use "#define Server_Max_Players = GetMaxClients() +1;" I don't get the line 94 error, but I still get the others as error 029's: invalid expression (as well as new ones later on). Does this actually set the variable to get the number of max clients each time it is called?
Is there a way to do what I want in a proper way?