Undefined Symbol & Invalid Expression
#1

Compile Errors:
Код:
C:\Documents and Settings\Administrator\Desktop\SC-RP\gamemodes\roleplay.pwn(1663) : error 017: undefined symbol "mysql_ping"
C:\Documents and Settings\Administrator\Desktop\SC-RP\gamemodes\roleplay.pwn(2082) : error 017: undefined symbol "foreach"
C:\Documents and Settings\Administrator\Desktop\SC-RP\gamemodes\roleplay.pwn(2082) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\Desktop\SC-RP\gamemodes\roleplay.pwn(2082) : error 017: undefined symbol "i"
C:\Documents and Settings\Administrator\Desktop\SC-RP\gamemodes\roleplay.pwn(2082) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Lines:
Код:
SQL_Connect() {
	g_iHandle = mysql_connect(SQL_HOSTNAME, SQL_USERNAME, SQL_DATABASE, SQL_PASSWORD);

	if (mysql_ping(g_iHandle) < 1) {
	    printf("[SQL] Connection to \"%s\" failed! Please check the connection settings...\a", SQL_HOSTNAME);
	}
	else {
		printf("[SQL] Connection to \"%s\" passed!", SQL_HOSTNAME);
	}
}

-----------------------------------------(Not in script, just separating code)---------------------------------------------
	static
	    Float:fX,
	    Float:fY,
	    Float:fZ;
	
	GetDynamicObjectPos(g_aFireObjects[0], fX, fY, fZ);
	
	foreach (new i : Player)
	{
	    if (GetFactionType(i) == FACTION_MEDIC)
	    {
			Waypoint_Set(i, "Fire Scene", fX, fY, fZ);
	    }
	}
Reply
#2

at the top of the script:
pawn Код:
#include <foreach>
and about the sql connect:
pawn Код:
SQL_Connect() {
    g_iHandle = mysql_connect(SQL_HOSTNAME, SQL_USERNAME, SQL_DATABASE, SQL_PASSWORD);

    if (mysql_errno(g_iHandle ) == 0) {
        printf("[SQL] Connection to \"%s\" failed! Please check the connection settings...\a", SQL_HOSTNAME);
    }
    else {
        printf("[SQL] Connection to \"%s\" passed!", SQL_HOSTNAME);
    }
}
If the above sql_connect didn't work or made an error then try:
pawn Код:
SQL_Connect() {
    g_iHandle = mysql_connect(SQL_HOSTNAME, SQL_USERNAME, SQL_DATABASE, SQL_PASSWORD);

    if (mysql_connection(g_iHandle ) == 0) {
        printf("[SQL] Connection to \"%s\" failed! Please check the connection settings...\a", SQL_HOSTNAME);
    }
    else {
        printf("[SQL] Connection to \"%s\" passed!", SQL_HOSTNAME);
    }
}
Reply
#3

You managed to fix my SQL problem, but my other problem is still here. I have #include <foreach> and still get this:

Quote:

C:\Documents and Settings\Administrator\Desktop\SC-RP\gamemodes\roleplay.pwn(2082) : error 017: undefined symbol "foreach"
C:\Documents and Settings\Administrator\Desktop\SC-RP\gamemodes\roleplay.pwn(2082) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\Desktop\SC-RP\gamemodes\roleplay.pwn(2082) : error 017: undefined symbol "i"
C:\Documents and Settings\Administrator\Desktop\SC-RP\gamemodes\roleplay.pwn(2082) : fatal error 107: too many error messages on one line

Reply
#4

You have to download the include "foreach" by ******.

Link
Reply
#5

Quote:
Originally Posted by meta1
Посмотреть сообщение
You have to download the include "foreach" by ******.

Link
Код:
C:\Documents and Settings\Administrator\Desktop\SC-RP\pawno\include\foreach.inc(228) : fatal error 100: cannot read from file: "YSI\internal\y_natives"
Any ideas?
Reply
#6

Download YSI library now.

Link
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)