SA-MP Forums Archive
"Undefined symbol" even though I've already defined them - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: "Undefined symbol" even though I've already defined them (/showthread.php?tid=230153)



"Undefined symbol" even though I've already defined them - TheOC - 23.02.2011

Hia,

I'm trying to add some pickups into my gamemode at the airports that subtract your money and then teleport you to another airport. I'm not sure if they even work yet because Pawn keeps reporting that the symbols are undefined.

Relevant pieces of code:
Code:
Line 10:  new LSAirportSouth;
Line 256: LSAirportSouth = CreatePickup(1239, 19, 1685.8397, -2333.0193, 13.3202);
Errors:
Code:
ocfreeroam01.pwn(256) : error 017: undefined symbol "LSAirportSouth"
I've been able to solve most of my problems with Pawn myself, but this problem is annoying the living hell out of me. I followed code samples from this forum and they worked for the people asking for help, I don't know why they're giving me errors.


Re: "Undefined symbol" even though I've already defined them - Serbish - 23.02.2011

Where did you put ' new LSAirportSouth; ' in your script ?


Re: "Undefined symbol" even though I've already defined them - TheOC - 23.02.2011

I placed it right after the includes and the definitions. This is where people suggested it should be.

I've also tried putting it in onSpawn, onInit, onPickup etc but it didn't help.


Re: "Undefined symbol" even though I've already defined them - Krx17 - 23.02.2011

Make sure you aren't missing any closing braces. The last guy that had this exact problem was missing a brace.


Re: "Undefined symbol" even though I've already defined them - TheOC - 23.02.2011

Everything looks closed to me.


Re: "Undefined symbol" even though I've already defined them - Serbish - 23.02.2011

The variable ' LSAirportSouth; ' should be placed outside any callback in this case.
Your ' LSAirportSouth = CreatePickup(...); ' should be placed inside the callback ' OnGameModeInit() ' in this case.


Re: "Undefined symbol" even though I've already defined them - GNGification - 23.02.2011

Try this (Im not sure does it work)

new LSAirportSouth[MAX_PLAYERS];


Re: "Undefined symbol" even though I've already defined them - THE_KNOWN - 23.02.2011

where is the virtual world argument in the createpickup :S


Re: "Undefined symbol" even though I've already defined them - Hiddos - 23.02.2011

Have you still got the "#define FILTERSCRIPT" line on top of your script (Either 'active' or commented)?


Re: "Undefined symbol" even though I've already defined them - TheOC - 23.02.2011

I tried both this:
Quote:
Originally Posted by Serbish
View Post
The variable ' LSAirportSouth; ' should be placed outside any callback in this case.
Your ' LSAirportSouth = CreatePickup(...); ' should be placed inside the callback ' OnGameModeInit() ' in this case.
and this:
Quote:
Originally Posted by Hiddos
View Post
Have you still got the "#define FILTERSCRIPT" line on top of your script (Either 'active' or commented)?
It compiled after both, I'm not sure which solved it. I was sure I already tried the first one and #define filterscript was commented out for some reason (though filterscripts were working), but I guess it's all fixed now.

Thanks everyone!