How to fix "Undefined Symbol" Error -
Sasino97 - 09.03.2011
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;
}
Re: How to fix "Undefined Symbol" Error -
Markx - 09.03.2011
Nice!
Re: How to fix "Undefined Symbol" Error -
Sasino97 - 09.03.2011
Thank you =)
Re: How to fix "Undefined Symbol" Error -
Davz*|*Criss - 09.03.2011
Good
Thankss
Re: How to fix "Undefined Symbol" Error -
Karl1195 - 09.03.2011
Nice one bro
Re: How to fix "Undefined Symbol" Error -
Marricio - 09.03.2011
You dont have this complete right?
What about
''Undefinied symbol 'playerid' '' or ''Undefinied symbol 'name' ''..
Re: How to fix "Undefined Symbol" Error -
Sasino97 - 10.03.2011
Quote:
Originally Posted by Marricio
You dont have this complete right?
''Undefinied symbol 'playerid'
|
This means that the function doesn't use playerid.
Quote:
Originally Posted by ******
If they only have the client, how are they compiling the code? I've not seen anyone have a compiler issue caused by not having the server because they don't have the compiler either...
|
I mean that they forgot to download the newest server package.
Thanks, I writed it.
Quote:
Originally Posted by Steven82
This...is just completely stupid and useless.
|
Yes, this thread should be deleted, because I suck.
Re: How to fix "Undefined Symbol" Error -
Sasino97 - 10.03.2011
Quote:
Originally Posted by ******
No it doesn't:
pawn Code:
foreach (Player, i) { SendClientMessage(playerid, COLOR_RED, "hi"); }
That's one of my most common mistakes - using "playerid" instead of "i", "playerid" is valid there if I had declared it in foreach, but I haven't here.
|
How do I declare it? What does "Player" in foreach?
Can you give me the link of your script ******, please?
Thanks for help : )
Re: How to fix "Undefined Symbol" Error -
WillyP - 02.04.2011
Quote:
Originally Posted by [GF]Sasino97
Yes, this thread should be deleted, because I suck.
|
Trololo.
And don't see why having the 0.3c client would do anything to the code :S
Re: How to fix "Undefined Symbol" Error -
TBS.Cyber - 09.08.2012
Thanks, helped alot