Invalid Function Call - 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: Invalid Function Call (
/showthread.php?tid=583918)
Invalid Function Call -
MotherDucker - 31.07.2015
Hello, I'm having a problem with enums and functions..
I get the error:
Код:
../Modules/Commands.pwn(3) : error 012: invalid function call, not a valid address
../Modules/Commands.pwn(3) : warning 215: expression has no effect
../Modules/Commands.pwn(3) : warning 215: expression has no effect
../Modules/Commands.pwn(3) : error 001: expected token: ";", but found ")"
../Modules/Commands.pwn(3) : error 029: invalid expression, assumed zero
../Modules/Commands.pwn(3) : fatal error 107: too many error messages on one line
from this code:
Код:
1 | CMD:tutorial(playerid, params[])
2 | {
3 | Tutorial(playerid, TempData[playerid][tutorialCount]);
4 | return 1;
5 | }
When I comment out the bool:Tutorial in my enum.. it seems to work.
Код:
155 | enum Temp_Data
156 | {
157 | bool:Tutorial
158 | }
Re: Invalid Function Call -
zT KiNgKoNg - 31.07.2015
Quote:
Originally Posted by MotherDucker
Hello, I'm having a problem with enums and functions..
I get the error:
Код:
../Modules/Commands.pwn(3) : error 012: invalid function call, not a valid address
../Modules/Commands.pwn(3) : warning 215: expression has no effect
../Modules/Commands.pwn(3) : warning 215: expression has no effect
../Modules/Commands.pwn(3) : error 001: expected token: ";", but found ")"
../Modules/Commands.pwn(3) : error 029: invalid expression, assumed zero
../Modules/Commands.pwn(3) : fatal error 107: too many error messages on one line
from this code:
Код:
1 | CMD:tutorial(playerid, params[])
2 | {
3 | Tutorial(playerid, TempData[playerid][tutorialCount]);
4 | return 1;
5 | }
When I comment out the bool:Tutorial in my enum.. it seems to work.
Код:
155 | enum Temp_Data
156 | {
157 | bool:Tutorial
158 | }
|
I've run into the same issue, with using a modular 'format'; But its only related to some files and the way the include structure is (Don't know why it affects it), So my advice would be to jiggle some of the structure around and see if that can fix the issue.
Until I can find a definitive way to access 'functions' within other file on compile without it spewing errors at me, that's the best I can really say.
Re: Invalid Function Call -
MotherDucker - 31.07.2015
Alright, I mean.. It works when the Tutorial boolean is either changed to something such as "tutorial" or commented.
But I will keep trying different things and update if anything changes.
Re: Invalid Function Call -
Vince - 31.07.2015
Isn't it obvious that you can't have a variable and a function with the same name? Coding conventions call for every function name to have a
verb in it. A function does something.
ShowTutorial,
ProcessTutorial,
PerformTutorial,
ExecuteTutorial or
SendToTutorial are all viable and if you really can't come up with anything you might as well use
DoTutorial.