[PLEASE HELP!!!]Error 008! +rep
#1

Hey all,
I'm trying to make a new function for may gamemode and when compile, my function gives me this error:
Код:
D:\Program Files\Rockstar Games\GTA San Andreas\server\pawno\include\bgedition.inc(203) : error 008: must be a constant expression; assumed zero
there is the function
Код:
196 stock DatabaseTable(connection, action[], tbname[], string[]) {
197	new query[1500], bool:Action = false;
198	if(strfind(action, "create", true)) {
199		Action = true;
200		mysql_format(connection, query, sizeof(query), "CREATE TABLE IF NOT EXISTS `%s`(%s)", tbname, string);
201		mysql_tquery(connection, query, "", "");
202	}
203	#if Action == false
204		#error DatabaseTable: The action is invalid!
205	#endif
206	return 1;
207 }
Can anyone help me, please?
Reply
#2

How should the compiler know what the value of "Action" is?
Reply
#3

I don't know.. That is my question, too.
Reply
#4

Actually nevermind, you cannot check this at compile time. You must check it at runtime because you depend on the value of a runtime variable. Try using assert(), although I believe it only properly works in main(). Perhaps it will display something if crashdetect is enabled.
Reply
#5

Ok sloved. Lock this topic. AND DO NOT BUMP IT, please!
Reply
#6

"Do not bump it". I really hate people pretending to be moderators.
Reply
#7

Quote:
Originally Posted by Luis-
Посмотреть сообщение
"Do not bump it". I really hate people pretending to be moderators.
Don't we all hate that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)