#include <a_samp>
// ... a few 'system' includes
// ... some variables
#include "packages/mysql/header.pwn" // yes, included
#include "packages/mysql/package.pwn" // yes, included
// ... some more includes ...
#include "packages/mysql/cache/cache_get_field_content_float.pwn" // yes, included
#include "packages/mysql/cache/cache_get_field_content_int.pwn" // no, not included
#include "packages/mysql/cache/cache_get_row_float.pwn" // no
#include "packages/mysql/cache/cache_get_row_int.pwn" // no
#include "packages/mysql/event/OnQueryError.pwn" // yes
#include "packages/mysql/event/OnQueryFinish.pwn" // no
#include "packages/mysql/mysql_fetch_field_row_float.pwn" // yes
#include "packages/mysql/mysql_fetch_field_row_int.pwn" // no
|
If you have two files with the same name - REGARDLESS OF FOLDER - only the first one will be included. Not sure if that's the issue here though. How are you determining if they're included or not?
|
#include <your_include>
|
For include what you have to do is, script and then save it (DONT COMPILE INCLUDES) in .inc extension and then use
pawn Код:
|
|
Errors, probably. Though I have noticed that the name of an include can not be longer than 14 characters (or was it 16?), including extension otherwise it won't work (properly).
|
#include "packages/mysql/cache/cache_get_field_content_float.pwn" // yes, included
#include "packages/mysql/cache/cache_get_field_content_int.pwn" // no, not included
|
Well, go ahead and just try to give it shorter names, just to test. I've ran into a similar problem once and it was fixed when I shortened the name of the include.
|
|
Actually, if there is a max length then the truncated names may look the same and thus trigger the issue I mentioned.
|
|
No, PAWN is open-source and is publically available, hence it is used in SA:MP. The compiler has been modified with use with SA:MP and although the open source modifications were lost I believe they have been recovered.
|
/* doinclude
*
* Gets the name of an include file, pushes the old file on the stack and
* sets some options. This routine doesn't use lex(), since lex() doesn't
* recognize file names (and directories).
*
* Global references: inpf (altered)
* inpfname (altered)
* lptr (altered)
*/
static void doinclude(int silent)
{
char name[_MAX_PATH];
char symname[sNAMEMAX];
char *ptr;
char c;
int i, result;
while (*lptr<=' ' && *lptr!='\0') /* skip leading whitespace */
lptr++;
if (*lptr=='<' || *lptr=='\"') {
c=(char)((*lptr=='\"') ? '\"' : '>'); /* termination character */
lptr++;
while (*lptr<=' ' && *lptr!='\0') /* skip whitespace after quote */
lptr++;
} else {
c='\0';
} /* if */
i=0;
while (*lptr!=c && *lptr!='\0' && i<sizearray(name)-1) /* find the end of the string */
name[i++]=*lptr++;
while (i>0 && name[i-1]<=' ')
i--; /* strip trailing whitespace */
assert(i>=0 && i<sizearray(name));
name[i]='\0'; /* zero-terminate the string */
if (*lptr!=c) { /* verify correct string termination */
error(37); /* invalid string */
return;
} /* if */
if (c!='\0')
check_empty(lptr+1); /* verify that the rest of the line is whitespace */
/* create a symbol from the name of the include file; this allows the system
* to test for multiple inclusions
*/
strcpy(symname,"_inc_");
if ((ptr=strrchr(name,DIRSEP_CHAR))!=NULL)
strlcat(symname,ptr+1,sizearray(symname));
else
strlcat(symname,name,sizearray(symname));
/* replace invalid characters by '_' (anything not a digit, character or
* underscore)
*/
for (i=0; symname[i]!='\0'; i++)
if (!alphanum(symname[i]))
symname[i]='_';
#if defined __WIN32__ || defined _WIN32 || defined _Windows || defined __MSDOS__
/* on systems with case-insentive filenames, force the symbol for the file
* to lower case
*/
strlwr(symname);
#endif
if (find_symbol(&glbtab,symname,fcurrent,-1)==NULL) {
/* constant is not present, so this file has not been included yet */
/* Include files between "..." or without quotes are read from the same
* relative path as the current file, from the active directory, or from
* a list of "include directories". Include files between <...> are only
* read from the list of include directories.
*/
result=plungefile(name,(c!='>'),TRUE);
if (result)
add_constant(symname,1,sGLOBAL,0);
else if (!silent)
error(100,name); /* cannot read from ... (fatal error) */
} /* if */
}