SA-MP Forums Archive
A question about marco - 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)
+--- Thread: A question about marco (/showthread.php?tid=434641)



A question about marco - yxliang - 03.05.2013

#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?


Re: A question about marco - Yashas - 03.05.2013

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??


Re: A question about marco - MP2 - 03.05.2013

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).


Re: A question about marco - Yashas - 03.05.2013

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^^


Re: A question about marco - Yashas - 03.05.2013

k Thanks, din kno that!!


Re: A question about marco - yxliang - 04.05.2013

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


Re: A question about marco - Yashas - 04.05.2013

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


Re: A question about marco - yxliang - 04.05.2013

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