Undefined symbol
#1

I am trying to make a hook of SetPlayerPos, but there is a problem:
pawn Code:
#if !defined SetPlayerPos
#error "WTF?"
#endif
#undef SetPlayerPos // line 71
compile:
Quote:

C:\blah_blah.blah(71) : error 017: undefined symbol "SetPlayerPos"
C:\blah_blah.blah(71) : error 010: invalid function or declaration

What am I doing wrong?
Reply
#2

SetPlayerPos is already in samp.inc? ...
Reply
#3

SetPlayerPos is in a_players.inc and that is in a_samp.inc but this is why i've added that check.
If it wouldn't be defined, it would say "user error: WTF?"
Reply
#4

Well, you undefined it. You have to define it back before using it ?
Reply
#5

but I can't undefine it. on the undef line, the compiler gives an error and that's what I don't get.
Reply
#6

The same if I do
pawn Code:
#if defined SetPlayerPos
#undef SetPlayerPos
#endif
Reply
#7

Get rid of
#if defined SetPlayerPos
#undef SetPlayerPos

Then you can use it as it is already included in a_samp so you must have at the top of your script
#include <a_samp> // Its a requirement to include it.
Reply
#8

>_< you did not caught what I meant.
Reply
#9

Lol this is funny!
pawn Code:
#include    < a_samp > // SetPlayerPos is defined on a_players.inc, which it is included in a_samp

#if !defined SetPlayerPos // If it's not defined
    #error "ROFLMAO!!!" // Instruct the compiler to make an error.
#else // Else
    #undef SetPlayerPos // Undefine it, error in this line.
#endif
Or just :
pawn Code:
#include < a_samp >

#undef SetPlayerPos // Error, SetPlayerPos is not defined =)
Got the same error, didn't even used SetPlayerPos.

My brains got confused ...
Reply
#10

You cant undefine a native, just READ THAT
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)