01.08.2016, 19:21
I'm just giving an extra method of doing that.
I think it's better, because strings with spaces can cause problems with detecting them in sscanf.
Код:
new value1, value2; if (!strcmp(params, "option1", true, 7)) { if (sscanf(params[8], "ii", value1, value2)) return Usage message "/cmd option1 [value1] [value2]"; } else if (!strcmp(params, "option2 ExtraOption", true, 19)) { if (sscanf(params[20], "i", value1)) return Usage message "/cmd option2 ExtraOption [value1]"; } /cmd [option] [whatever]