Can't read from files. - 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: Can't read from files. (
/showthread.php?tid=567499)
Can't read from files. -
f0cus - 14.03.2015
Hey. I got some problems with reading files and I don't know why that's happening.
I'll try to explain with example:
PHP код:
#include "data/some/other/folders/firstfile.pwn"
#include "data/some/other/folders/secondfile.pwn".
First file content:
PHP код:
forward firstfilefunction();
public firstfilefunction()
{
return 1;
}
Second file content:
PHP код:
forward secondfilefunction();
public secondfilefunction()
{
return 1;
}
It doesn't shows any errors when including (I mean "can't read from file..."), but I can't use functions; f.e:
PHP код:
public OnGameModeInit()
{
firstfilefunction();
secondfilefunction();
}
It shows
Код HTML:
error 017: undefined symbol secondfilefunction()
.
When I switch these includes (first include "secondfile.pwn", then "firstfile.pwn") it shows
Код HTML:
error 017: undefined symbol firstfilefunction()
So what's happening
Re: Can't read from files. -
Vince - 14.03.2015
An include path can be maximum 30-ish characters total length. If it's longer than that you will get weird bugs.
Re: Can't read from files. -
f0cus - 14.03.2015
Quote:
Originally Posted by Vince
An include path can be maximum 30-ish characters total length. If it's longer than that you will get weird bugs.
|
Thanks man, working now. But maybe it's possible to make the path working when it's longer the 30 chars ?
AW: Can't read from files. -
Nero_3D - 14.03.2015
Change the forward slashes to backward ones otherwise the include gets blocked by the include guard if the path is to long
Re: Can't read from files. -
f0cus - 14.03.2015
Thanks guys, everything works fine now
L&A