SA-MP Forums Archive
Undefined Symbol & Invalid Expression - 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: Undefined Symbol & Invalid Expression (/showthread.php?tid=545847)



Undefined Symbol & Invalid Expression - FeaRXPhobia - 11.11.2014

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);
	    }
	}



Re: Undefined Symbol & Invalid Expression - Eth - 11.11.2014

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);
    }
}



Re: Undefined Symbol & Invalid Expression - FeaRXPhobia - 11.11.2014

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




Re: Undefined Symbol & Invalid Expression - meta1 - 11.11.2014

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

Link


Re: Undefined Symbol & Invalid Expression - FeaRXPhobia - 11.11.2014

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?


Re: Undefined Symbol & Invalid Expression - meta1 - 11.11.2014

Download YSI library now.

Link