Enum's
Hi,
why would this have errors ? : PHP Code:
Quote:
PHP Code:
Quote:
PHP Code:
|
Re: Enum's
g_PlayerData is an array, and PlayerInfo is an enum.
You cannot create an array using other array as dimension. Quote:
Quote:
|
Re: Enum's
You are getting those errors because you are trying to declare an array size with a non constant value/uncomplete memory address of the var, declaring an array size should be done with pre defined size so the compiler would know what size it should be assigned for.
Note: Also declaring global array variables should always be in the first of the script and thier sizes before them |
Re: Enum's
Quote:
Quote:
PHP Code:
PHP Code:
|
Re: Enum's
Either technically works but I prefer the first since it indicates what you are holding in the array. MAX_PLAYERS is used across the majority of plugins and everyone knows what it corresponds to. G_PLAYER_DATA_SIZE does not tell the same story.
|
| All times are GMT -4. The time now is 17:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.