[PLEASE HELP!!!]Error 008! +rep - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [PLEASE HELP!!!]Error 008! +rep (
/showthread.php?tid=575484)
[PLEASE HELP!!!]Error 008! +rep -
bgedition - 27.05.2015
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?
Re: [PLEASE HELP!!!]Error 008! +rep -
Vince - 27.05.2015
How should the compiler know what the value of "Action" is?
Re: [PLEASE HELP!!!]Error 008! +rep -
bgedition - 27.05.2015
I don't know.. That is my question, too.
Re: [PLEASE HELP!!!]Error 008! +rep -
Vince - 27.05.2015
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.
Re: [PLEASE HELP!!!]Error 008! +rep -
bgedition - 27.05.2015
Ok sloved. Lock this topic. AND DO NOT BUMP IT, please!
Re: [PLEASE HELP!!!]Error 008! +rep -
Luis- - 27.05.2015
"Do not bump it". I really hate people pretending to be moderators.
Re: [PLEASE HELP!!!]Error 008! +rep -
Cookland - 27.05.2015
Quote:
Originally Posted by Luis-
"Do not bump it". I really hate people pretending to be moderators.
|
Don't we all hate that?