A question about marco
#1

#define HI_x x
HI_SetPlayerPos(playerid,0.0,0.0,0.0);

and the compiler occur error undefined "HI_SetPlayerPos".

How to fix that? I should be ok, isn't it?
Reply
#2

1. The difine is useless does nothing in the script
2. The error "undefined" tells that the function is not declared, so just go and declare it somewhere.

And SetPlayerPos has same parameters.Then what are trying by creating a new function??
Reply
#3

Who's marco? What are you trying to do? Hook a function? That isn't going to do anything, just redirect HI_SetPlayerPos to SetPlayerPos (though, the x should be %0).
Reply
#4

Were you trying to make like this
#define HI_x x and make HI_SetPlayerPos work as SetPlayerPos??You can't do that!!!You need to specify an end for the compiler to understand

like this

Код:
#define HI_%0(  %0(
x is not any keyword or as such that is used to give paramters to defines, its %0,%1,%2... that tells!

This might work.Try^^
Reply
#5

k Thanks, din kno that!!
Reply
#6

Thank you everyone. Because macro in C does not permit %0 so I use x instead.
Reply
#7

AH!!Someone like me!! Even I get messed up with C++/C with PAWN.More than 100 times!!
Reply
#8

Quote:
Originally Posted by ******
Посмотреть сообщение
Just imagine the chaos if that wasn't the case:

pawn Код:
#define f%0(%1) %0(%1)

for (...) // Becomes: or (...)
SO MANY errors, and it would be almost impossible to code anything!
****** can read the post?HERE
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)