[help] Need a define that returns a formatted string
#2

pawn Код:
#define PLUR(%0,%1,%2) (%0),((%0) == 1)?((#%1)):((#%2))
Usage:
pawn Код:
format(string, sizeof(string), "%i %s", PLUR(var, "instance", "instances");
for example
pawn Код:
PLUR(pKills[playerid], "kill", "kills");
Look at the macro code and take it from it. I don't understand it.
Reply


Messages In This Thread
[help] Need a define that returns a formatted string - by DeathTone - 08.05.2012, 03:21
Re: [help] Need a define that returns a formatted string - by MP2 - 08.05.2012, 06:45
Re: [help] Need a define that returns a formatted string - by 2KY - 08.05.2012, 11:34
Re: [help] Need a define that returns a formatted string - by 2KY - 08.05.2012, 11:37
Re: [help] Need a define that returns a formatted string - by DeathTone - 08.05.2012, 22:50

Forum Jump:


Users browsing this thread: 3 Guest(s)