format and #define question
#1

hi, what am i doing wrong?

i want the "ALTERNATIVE_NAME" to return mike`

Код:
#define FirstName "mike"
#define ALTERNATIVE_NAME return format(ALTERNATIVE_NAME,sizeof(ALTERNATIVE_NAME), "%s%c", FirstName,"'");
Reply
#2

? you want only players in your server with Firstname_Lastname?
Reply
#3

Quote:
Originally Posted by [69
StreetGT ]
? you want only players in your server with Firstname_Lastname?
No, i am asking about the syntax and structure of the code, not an inquisition on what i want it for :/
Reply
#4

i dont believe you need the return

what you are doing is setting ALTERNATIVE_NAME to basically run the code after it


so later on in your script you would do:

Код:
ALTERNATIVE_NAME
SendClientMessage(playerid, 0x00000000, DIFFERENT_VARIABLE);
your define cannot use itself to replace the code but it can use it

example:
Код:
new string[128];
#define ALTERNATIVE_NAME format(string,sizeof(string), "%s%c", FirstName,"'");
later in script

Код:
ALTERNATIVE_NAME
SendClientMessage(playerid, 0x00000000, string);
Reply
#5

worked a treat,
thankyou adsy
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)