SA-MP Forums Archive
#define macro - 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: #define macro (/showthread.php?tid=600380)



#define macro - graef - 07.02.2016

Basically, i need same macro in different type, just like this:
#define Player: Player_
#define Player:%0[%1] Player[%1][_%0]

I tried to do this but i got error.
Code:
#define Player:%0 PLAYER|||SECOND|||_%0|||
#define PLAYER|||SECOND|||%0[_%1]||| Player[%1][%0]
#define PLAYER|||SECOND|||_%0||| Player_
Code:
Player/player/header.pwn(27) : warning 201: redefinition of constant/macro (symbol "PLAYER|||SECOND|||_%0|||")



Re: #define macro - Stanford - 07.02.2016

I just don't get what you want to do exactly, can you put an example?


Re: #define macro - graef - 07.02.2016

Example is there, i want make "Player:" in 2 different method,
First method: Player:count will be transform to Player_count
Second method: Player:name[playerid] will be transform to Player[playerid][name]