[Tutorial] How to fix "Undefined Symbol" Error
#1

How do I fix errors like this:

Code:
C:\Users\(User Name)\Desktop\sa-mp 0.3c Server\gamemodes\(GM NAME).pwn(584) : error 017: undefined symbol "bla bla bla"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
?

WHY THIS THREAD

I published this thread because I see a lot of people posting:

Quote:

"Why Undefined symbol? ?"
"But have sa-mp 0.3c!!"

Cause you have only the newest client, You have to download the last includes too.

WHY THIS ERROR

This error shows when you type something that the compiler doesn't know.

The problems can be:

1. You don't have the SA-MP server includes.
2. You made some writing mistakes.
3. You haven't created that stock, public or #define.


1. To fix the 1st you have to download the includes from the sa-mp team.
Download link

2. To fix the second press on the "Replace" window and first type the mistake, and in the second box the correction.

3.1 Don't call it.
3.2 Create a function with that name.

EXAMPLES

Example 1.
pawn Code:
public OnPlayerConnect(playerid)
{
  ShowPlayerDialog(etc...);
  return 1;
}
If this gives you an error, it's because you are using 0.3a or 0.3b.

Example 2.
pawn Code:
public OnPlayerConnect(playerid)
{
    GivePlayerMonu(playerid, 500);
    return 1;
}
Fix with

pawn Code:
public OnPlayerConnect(playerid)
{
    GivePlayerMoney(playerid, 500);
    return 1;
}
Example 3.

pawn Code:
public OnPlayerConnect(playerid)
{
    SetPlayerHealthAndArmour(playerid, 55);
    return 1;
}
To fix with:

3.1 Just don't call it

pawn Code:
public OnPlayerConnect(playerid)
{
    SetPlayerHealth(playerid, 55);
    SetPlayerArmour(playerid, 55);
    return 1;
}
or

3.2 Add that function

pawn Code:
public OnPlayerConnect(playerid)
{
    SetPlayerHealthAndArmour(playerid, 55);
    return 1;
}

stock SetPlayerHealthAndArmour(playerid, Float:Value)
{
    SetPlayerHealth(playerid, Value);
    SetPlayerArmour(playerid, Value);
    return 1;
}
Reply


Messages In This Thread
How to fix "Undefined Symbol" Error - by Sasino97 - 09.03.2011, 19:19
Re: How to fix "Undefined Symbol" Error - by Markx - 09.03.2011, 19:24
Re: How to fix "Undefined Symbol" Error - by Sasino97 - 09.03.2011, 19:30
Re: How to fix "Undefined Symbol" Error - by Davz*|*Criss - 09.03.2011, 19:30
Re: How to fix "Undefined Symbol" Error - by Karl1195 - 09.03.2011, 19:36
Re: How to fix "Undefined Symbol" Error - by Marricio - 09.03.2011, 21:08
Re: How to fix "Undefined Symbol" Error - by Sasino97 - 10.03.2011, 11:36
Re: How to fix "Undefined Symbol" Error - by Sasino97 - 10.03.2011, 14:05
Re: How to fix "Undefined Symbol" Error - by WillyP - 02.04.2011, 11:50
Re: How to fix "Undefined Symbol" Error - by TBS.Cyber - 09.08.2012, 10:33

Forum Jump:


Users browsing this thread: 2 Guest(s)