Issue with sizeof(array) strings and enums
#3

While trying to create a new file to show the issue is not with other code, I discovered what I believe to be the problem.

Код:
#include <a_samp>
#include <YSI_Coding\y_hooks>

#define SALT_LENGTH 65
#define PASSWORD_LENGTH 65

enum e_PlayerInfo {
	Player_Name[MAX_PLAYER_NAME],
	Player_Password[PASSWORD_LENGTH],
	Player_Salt[SALT_LENGTH]
};

new Player[MAX_PLAYERS][e_PlayerInfo];

main(){}

OnGameModeInit() {
	printf("%i", sizeof(Player[0][Player_Name]));
}
Upon commenting out the y_hooks include, the compile errors immediately disappeared.
I would test to see if this completely solved the issue, but the script requires y_hooks.

Did I set something up wrong with y_hooks? I'm not sure why it would modify sizeof(), but maybe that's just my ignorance of how it works.
Reply


Messages In This Thread
Issue with sizeof(array) strings and enums - by Aire - 06.12.2018, 14:37
Re: Issue with sizeof(array) strings and enums - by coool - 06.12.2018, 14:56
Re: Issue with sizeof(array) strings and enums - by Aire - 06.12.2018, 15:13
Re: Issue with sizeof(array) strings and enums - by Aire - 06.12.2018, 16:12
Re: Issue with sizeof(array) strings and enums - by Aire - 06.12.2018, 19:15

Forum Jump:


Users browsing this thread: 1 Guest(s)